{"size": 1138, "ext": "js", "max_stars_repo_path": "core/toolkit.js", "max_stars_repo_name": "Sector22/sector22", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "core/toolkit.js", "max_issues_repo_name": "Sector22/sector22", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "core/toolkit.js", "max_forks_repo_name": "Sector22/sector22", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.0740740741, "max_line_length": 115, "alphanum_fraction": 0.6643233743}
/**
 * @author Geert Fokke [geert@sector22.com]
 * @www sector22.com
 */

// @formatter:off

// Pull in commonly used polyfills
require( './polyfill/animationFrame' )();
require( './polyfill/console' )();
require( './polyfill/object' )();
require( './polyfill/location' )();
require( './polyfill/document' )();

var log   = require( './debug/Log' ).getInstance();

// @formatter:on

/**
 * Core object containing global scope object and info about this framework.
 * @namespace
 */
var toolkit = {};
var namespaces = {};


toolkit.defineNamespace = function ( name, value ) {

    if( toolkit.hasNamespace( name ) ) return log.error( 'toolkit', 'namespace \'' + name + '\' already exists!' );

    namespaces[ name ] = value;

}

toolkit.getNamespace = function ( name, opt_defaultValue ) {

    if( opt_defaultValue !== undefined && !toolkit.hasNamespace( name ) ) namespaces[ name ] = opt_defaultValue;

    return namespaces[ name ];

}

toolkit.hasNamespace = function ( name ) {

    return namespaces[ name ] !== undefined;

}

Object.freeze( toolkit ) // lock the object to minimize accidental changes

module.exports = toolkit;


