From 38c89b5759265bb5211f3557db14aa552dcabdc2 Mon Sep 17 00:00:00 2001 From: imasustink Date: Thu, 2 Nov 2017 09:37:52 -0700 Subject: [PATCH] 0.2.6 --- dist/amd/can-globals-instance.js | 22 + dist/amd/can-globals-proto.js | 133 ++++++ dist/amd/can-globals.js | 25 ++ dist/amd/document/document.js | 20 + dist/amd/global/global.js | 18 + .../is-browser-window/is-browser-window.js | 18 + dist/amd/location/location.js | 20 + .../mutation-observer/mutation-observer.js | 21 + dist/cjs/can-globals-instance.js | 10 + dist/cjs/can-globals-proto.js | 122 ++++++ dist/cjs/can-globals.js | 9 + dist/cjs/document/document.js | 8 + dist/cjs/global/global.js | 7 + .../is-browser-window/is-browser-window.js | 7 + dist/cjs/location/location.js | 8 + .../mutation-observer/mutation-observer.js | 9 + dist/global/can-globals.js | 412 ++++++++++++++++++ 17 files changed, 869 insertions(+) create mode 100644 dist/amd/can-globals-instance.js create mode 100644 dist/amd/can-globals-proto.js create mode 100644 dist/amd/can-globals.js create mode 100644 dist/amd/document/document.js create mode 100644 dist/amd/global/global.js create mode 100644 dist/amd/is-browser-window/is-browser-window.js create mode 100644 dist/amd/location/location.js create mode 100644 dist/amd/mutation-observer/mutation-observer.js create mode 100644 dist/cjs/can-globals-instance.js create mode 100644 dist/cjs/can-globals-proto.js create mode 100644 dist/cjs/can-globals.js create mode 100644 dist/cjs/document/document.js create mode 100644 dist/cjs/global/global.js create mode 100644 dist/cjs/is-browser-window/is-browser-window.js create mode 100644 dist/cjs/location/location.js create mode 100644 dist/cjs/mutation-observer/mutation-observer.js create mode 100644 dist/global/can-globals.js diff --git a/dist/amd/can-globals-instance.js b/dist/amd/can-globals-instance.js new file mode 100644 index 0000000..7e3b503 --- /dev/null +++ b/dist/amd/can-globals-instance.js @@ -0,0 +1,22 @@ +/*can-globals@0.2.5#can-globals-instance*/ +define([ + 'require', + 'exports', + 'module', + 'can-namespace', + './can-globals-proto' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var namespace = require('can-namespace'); + var Globals = require('./can-globals-proto'); + var globals = new Globals(); + if (namespace.globals) { + throw new Error('You can\'t have two versions of can-globals, check your dependencies'); + } else { + module.exports = namespace.globals = globals; + } + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/can-globals-proto.js b/dist/amd/can-globals-proto.js new file mode 100644 index 0000000..aa3508c --- /dev/null +++ b/dist/amd/can-globals-proto.js @@ -0,0 +1,133 @@ +/*can-globals@0.2.5#can-globals-proto*/ +define([ + 'require', + 'exports', + 'module', + 'can-reflect' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var canReflect = require('can-reflect'); + function dispatch(key) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var handlersCopy = handlers.slice(); + var value = this.getKeyValue(key); + for (var i = 0; i < handlersCopy.length; i++) { + handlersCopy[i](value); + } + } + } + function Globals() { + this.eventHandlers = {}; + this.properties = {}; + } + Globals.prototype.define = function (key, value, enableCache) { + if (enableCache === undefined) { + enableCache = true; + } + if (!this.properties[key]) { + this.properties[key] = { + default: value, + value: value, + enableCache: enableCache + }; + } + return this; + }; + Globals.prototype.getKeyValue = function (key) { + var property = this.properties[key]; + if (property) { + if (typeof property.value === 'function') { + if (property.cachedValue) { + return property.cachedValue; + } + if (property.enableCache) { + property.cachedValue = property.value(); + return property.cachedValue; + } else { + return property.value(); + } + } + return property.value; + } + }; + Globals.prototype.makeExport = function (key) { + return function (value) { + if (arguments.length === 0) { + return this.getKeyValue(key); + } + if (typeof value === 'undefined' || value === null) { + this.deleteKeyValue(key); + } else { + if (typeof value === 'function') { + this.setKeyValue(key, function () { + return value; + }); + } else { + this.setKeyValue(key, value); + } + return value; + } + }.bind(this); + }; + Globals.prototype.offKeyValue = function (key, handler) { + if (this.properties[key]) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var i = handlers.indexOf(handler); + handlers.splice(i, 1); + } + } + return this; + }; + Globals.prototype.onKeyValue = function (key, handler) { + if (this.properties[key]) { + if (!this.eventHandlers[key]) { + this.eventHandlers[key] = []; + } + this.eventHandlers[key].push(handler); + } + return this; + }; + Globals.prototype.deleteKeyValue = function (key) { + var property = this.properties[key]; + if (property !== undefined) { + property.value = property.default; + property.cachedValue = undefined; + dispatch.call(this, key); + } + return this; + }; + Globals.prototype.setKeyValue = function (key, value) { + if (!this.properties[key]) { + return this.define(key, value); + } + var property = this.properties[key]; + property.value = value; + property.cachedValue = undefined; + dispatch.call(this, key); + return this; + }; + Globals.prototype.reset = function () { + for (var key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + this.properties[key].value = this.properties[key].default; + this.properties[key].cachedValue = undefined; + dispatch.call(this, key); + } + } + return this; + }; + canReflect.assignSymbols(Globals.prototype, { + 'can.getKeyValue': Globals.prototype.getKeyValue, + 'can.setKeyValue': Globals.prototype.setKeyValue, + 'can.deleteKeyValue': Globals.prototype.deleteKeyValue, + 'can.onKeyValue': Globals.prototype.onKeyValue, + 'can.offKeyValue': Globals.prototype.offKeyValue + }); + module.exports = Globals; + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/can-globals.js b/dist/amd/can-globals.js new file mode 100644 index 0000000..c26496e --- /dev/null +++ b/dist/amd/can-globals.js @@ -0,0 +1,25 @@ +/*can-globals@0.2.5#can-globals*/ +define([ + 'require', + 'exports', + 'module', + './can-globals-instance', + './global/global', + './document/document', + './location/location', + './mutation-observer/mutation-observer', + './is-browser-window/is-browser-window' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('./can-globals-instance'); + require('./global/global'); + require('./document/document'); + require('./location/location'); + require('./mutation-observer/mutation-observer'); + require('./is-browser-window/is-browser-window'); + module.exports = globals; + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/document/document.js b/dist/amd/document/document.js new file mode 100644 index 0000000..c1caec0 --- /dev/null +++ b/dist/amd/document/document.js @@ -0,0 +1,20 @@ +/*can-globals@0.2.5#document/document*/ +define([ + 'require', + 'exports', + 'module', + '../global/global', + '../can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('../global/global'); + var globals = require('../can-globals-instance'); + globals.define('document', function () { + return globals.getKeyValue('global').document; + }); + module.exports = globals.makeExport('document'); + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/global/global.js b/dist/amd/global/global.js new file mode 100644 index 0000000..7e041c4 --- /dev/null +++ b/dist/amd/global/global.js @@ -0,0 +1,18 @@ +/*can-globals@0.2.5#global/global*/ +define([ + 'require', + 'exports', + 'module', + '../can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('../can-globals-instance'); + globals.define('global', function () { + return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : typeof process === 'object' && {}.toString.call(process) === '[object process]' ? global : window; + }); + module.exports = globals.makeExport('global'); + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/is-browser-window/is-browser-window.js b/dist/amd/is-browser-window/is-browser-window.js new file mode 100644 index 0000000..bed44e3 --- /dev/null +++ b/dist/amd/is-browser-window/is-browser-window.js @@ -0,0 +1,18 @@ +/*can-globals@0.2.5#is-browser-window/is-browser-window*/ +define([ + 'require', + 'exports', + 'module', + '../can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('../can-globals-instance'); + globals.define('isBrowserWindow', function () { + return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof SimpleDOM === 'undefined'; + }); + module.exports = globals.makeExport('isBrowserWindow'); + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/location/location.js b/dist/amd/location/location.js new file mode 100644 index 0000000..976831c --- /dev/null +++ b/dist/amd/location/location.js @@ -0,0 +1,20 @@ +/*can-globals@0.2.5#location/location*/ +define([ + 'require', + 'exports', + 'module', + '../global/global', + '../can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('../global/global'); + var globals = require('../can-globals-instance'); + globals.define('location', function () { + return globals.getKeyValue('global').location; + }); + module.exports = globals.makeExport('location'); + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/amd/mutation-observer/mutation-observer.js b/dist/amd/mutation-observer/mutation-observer.js new file mode 100644 index 0000000..b096f5c --- /dev/null +++ b/dist/amd/mutation-observer/mutation-observer.js @@ -0,0 +1,21 @@ +/*can-globals@0.2.5#mutation-observer/mutation-observer*/ +define([ + 'require', + 'exports', + 'module', + '../global/global', + '../can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('../global/global'); + var globals = require('../can-globals-instance'); + globals.define('MutationObserver', function () { + var GLOBAL = globals.getKeyValue('global'); + return GLOBAL.MutationObserver || GLOBAL.WebKitMutationObserver || GLOBAL.MozMutationObserver; + }); + module.exports = globals.makeExport('MutationObserver'); + }(function () { + return this; + }())); +}); \ No newline at end of file diff --git a/dist/cjs/can-globals-instance.js b/dist/cjs/can-globals-instance.js new file mode 100644 index 0000000..a1556b2 --- /dev/null +++ b/dist/cjs/can-globals-instance.js @@ -0,0 +1,10 @@ +/*can-globals@0.2.5#can-globals-instance*/ +'use strict'; +var namespace = require('can-namespace'); +var Globals = require('./can-globals-proto.js'); +var globals = new Globals(); +if (namespace.globals) { + throw new Error('You can\'t have two versions of can-globals, check your dependencies'); +} else { + module.exports = namespace.globals = globals; +} \ No newline at end of file diff --git a/dist/cjs/can-globals-proto.js b/dist/cjs/can-globals-proto.js new file mode 100644 index 0000000..5342b17 --- /dev/null +++ b/dist/cjs/can-globals-proto.js @@ -0,0 +1,122 @@ +/*can-globals@0.2.5#can-globals-proto*/ +'use strict'; +var canReflect = require('can-reflect'); +function dispatch(key) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var handlersCopy = handlers.slice(); + var value = this.getKeyValue(key); + for (var i = 0; i < handlersCopy.length; i++) { + handlersCopy[i](value); + } + } +} +function Globals() { + this.eventHandlers = {}; + this.properties = {}; +} +Globals.prototype.define = function (key, value, enableCache) { + if (enableCache === undefined) { + enableCache = true; + } + if (!this.properties[key]) { + this.properties[key] = { + default: value, + value: value, + enableCache: enableCache + }; + } + return this; +}; +Globals.prototype.getKeyValue = function (key) { + var property = this.properties[key]; + if (property) { + if (typeof property.value === 'function') { + if (property.cachedValue) { + return property.cachedValue; + } + if (property.enableCache) { + property.cachedValue = property.value(); + return property.cachedValue; + } else { + return property.value(); + } + } + return property.value; + } +}; +Globals.prototype.makeExport = function (key) { + return function (value) { + if (arguments.length === 0) { + return this.getKeyValue(key); + } + if (typeof value === 'undefined' || value === null) { + this.deleteKeyValue(key); + } else { + if (typeof value === 'function') { + this.setKeyValue(key, function () { + return value; + }); + } else { + this.setKeyValue(key, value); + } + return value; + } + }.bind(this); +}; +Globals.prototype.offKeyValue = function (key, handler) { + if (this.properties[key]) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var i = handlers.indexOf(handler); + handlers.splice(i, 1); + } + } + return this; +}; +Globals.prototype.onKeyValue = function (key, handler) { + if (this.properties[key]) { + if (!this.eventHandlers[key]) { + this.eventHandlers[key] = []; + } + this.eventHandlers[key].push(handler); + } + return this; +}; +Globals.prototype.deleteKeyValue = function (key) { + var property = this.properties[key]; + if (property !== undefined) { + property.value = property.default; + property.cachedValue = undefined; + dispatch.call(this, key); + } + return this; +}; +Globals.prototype.setKeyValue = function (key, value) { + if (!this.properties[key]) { + return this.define(key, value); + } + var property = this.properties[key]; + property.value = value; + property.cachedValue = undefined; + dispatch.call(this, key); + return this; +}; +Globals.prototype.reset = function () { + for (var key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + this.properties[key].value = this.properties[key].default; + this.properties[key].cachedValue = undefined; + dispatch.call(this, key); + } + } + return this; +}; +canReflect.assignSymbols(Globals.prototype, { + 'can.getKeyValue': Globals.prototype.getKeyValue, + 'can.setKeyValue': Globals.prototype.setKeyValue, + 'can.deleteKeyValue': Globals.prototype.deleteKeyValue, + 'can.onKeyValue': Globals.prototype.onKeyValue, + 'can.offKeyValue': Globals.prototype.offKeyValue +}); +module.exports = Globals; \ No newline at end of file diff --git a/dist/cjs/can-globals.js b/dist/cjs/can-globals.js new file mode 100644 index 0000000..1bbcdb2 --- /dev/null +++ b/dist/cjs/can-globals.js @@ -0,0 +1,9 @@ +/*can-globals@0.2.5#can-globals*/ +'use strict'; +var globals = require('./can-globals-instance.js'); +require('./global/global.js'); +require('./document/document.js'); +require('./location/location.js'); +require('./mutation-observer/mutation-observer.js'); +require('./is-browser-window/is-browser-window.js'); +module.exports = globals; \ No newline at end of file diff --git a/dist/cjs/document/document.js b/dist/cjs/document/document.js new file mode 100644 index 0000000..5f6bff6 --- /dev/null +++ b/dist/cjs/document/document.js @@ -0,0 +1,8 @@ +/*can-globals@0.2.5#document/document*/ +'use strict'; +require('../global/global.js'); +var globals = require('../can-globals-instance.js'); +globals.define('document', function () { + return globals.getKeyValue('global').document; +}); +module.exports = globals.makeExport('document'); \ No newline at end of file diff --git a/dist/cjs/global/global.js b/dist/cjs/global/global.js new file mode 100644 index 0000000..6524511 --- /dev/null +++ b/dist/cjs/global/global.js @@ -0,0 +1,7 @@ +/*can-globals@0.2.5#global/global*/ +'use strict'; +var globals = require('../can-globals-instance.js'); +globals.define('global', function () { + return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : typeof process === 'object' && {}.toString.call(process) === '[object process]' ? global : window; +}); +module.exports = globals.makeExport('global'); \ No newline at end of file diff --git a/dist/cjs/is-browser-window/is-browser-window.js b/dist/cjs/is-browser-window/is-browser-window.js new file mode 100644 index 0000000..f52c452 --- /dev/null +++ b/dist/cjs/is-browser-window/is-browser-window.js @@ -0,0 +1,7 @@ +/*can-globals@0.2.5#is-browser-window/is-browser-window*/ +'use strict'; +var globals = require('../can-globals-instance.js'); +globals.define('isBrowserWindow', function () { + return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof SimpleDOM === 'undefined'; +}); +module.exports = globals.makeExport('isBrowserWindow'); \ No newline at end of file diff --git a/dist/cjs/location/location.js b/dist/cjs/location/location.js new file mode 100644 index 0000000..fd8bbfa --- /dev/null +++ b/dist/cjs/location/location.js @@ -0,0 +1,8 @@ +/*can-globals@0.2.5#location/location*/ +'use strict'; +require('../global/global.js'); +var globals = require('../can-globals-instance.js'); +globals.define('location', function () { + return globals.getKeyValue('global').location; +}); +module.exports = globals.makeExport('location'); \ No newline at end of file diff --git a/dist/cjs/mutation-observer/mutation-observer.js b/dist/cjs/mutation-observer/mutation-observer.js new file mode 100644 index 0000000..0da4d74 --- /dev/null +++ b/dist/cjs/mutation-observer/mutation-observer.js @@ -0,0 +1,9 @@ +/*can-globals@0.2.5#mutation-observer/mutation-observer*/ +'use strict'; +require('../global/global.js'); +var globals = require('../can-globals-instance.js'); +globals.define('MutationObserver', function () { + var GLOBAL = globals.getKeyValue('global'); + return GLOBAL.MutationObserver || GLOBAL.WebKitMutationObserver || GLOBAL.MozMutationObserver; +}); +module.exports = globals.makeExport('MutationObserver'); \ No newline at end of file diff --git a/dist/global/can-globals.js b/dist/global/can-globals.js new file mode 100644 index 0000000..d071e13 --- /dev/null +++ b/dist/global/can-globals.js @@ -0,0 +1,412 @@ +/*[global-shim-start]*/ +(function(exports, global, doEval) { + // jshint ignore:line + var origDefine = global.define; + + var get = function(name) { + var parts = name.split("."), + cur = global, + i; + for (i = 0; i < parts.length; i++) { + if (!cur) { + break; + } + cur = cur[parts[i]]; + } + return cur; + }; + var set = function(name, val) { + var parts = name.split("."), + cur = global, + i, + part, + next; + for (i = 0; i < parts.length - 1; i++) { + part = parts[i]; + next = cur[part]; + if (!next) { + next = cur[part] = {}; + } + cur = next; + } + part = parts[parts.length - 1]; + cur[part] = val; + }; + var useDefault = function(mod) { + if (!mod || !mod.__esModule) return false; + var esProps = { __esModule: true, default: true }; + for (var p in mod) { + if (!esProps[p]) return false; + } + return true; + }; + + var hasCjsDependencies = function(deps) { + return ( + deps[0] === "require" && deps[1] === "exports" && deps[2] === "module" + ); + }; + + var modules = + (global.define && global.define.modules) || + (global._define && global._define.modules) || + {}; + var ourDefine = (global.define = function(moduleName, deps, callback) { + var module; + if (typeof deps === "function") { + callback = deps; + deps = []; + } + var args = [], + i; + for (i = 0; i < deps.length; i++) { + args.push( + exports[deps[i]] + ? get(exports[deps[i]]) + : modules[deps[i]] || get(deps[i]) + ); + } + // CJS has no dependencies but 3 callback arguments + if (hasCjsDependencies(deps) || (!deps.length && callback.length)) { + module = { exports: {} }; + args[0] = function(name) { + return exports[name] ? get(exports[name]) : modules[name]; + }; + args[1] = module.exports; + args[2] = module; + } else if (!args[0] && deps[0] === "exports") { + // Babel uses the exports and module object. + module = { exports: {} }; + args[0] = module.exports; + if (deps[1] === "module") { + args[1] = module; + } + } else if (!args[0] && deps[0] === "module") { + args[0] = { id: moduleName }; + } + + global.define = origDefine; + var result = callback ? callback.apply(null, args) : undefined; + global.define = ourDefine; + + // Favor CJS module.exports over the return value + result = module && module.exports ? module.exports : result; + modules[moduleName] = result; + + // Set global exports + var globalExport = exports[moduleName]; + if (globalExport && !get(globalExport)) { + if (useDefault(result)) { + result = result["default"]; + } + set(globalExport, result); + } + }); + global.define.orig = origDefine; + global.define.modules = modules; + global.define.amd = true; + ourDefine("@loader", [], function() { + // shim for @@global-helpers + var noop = function() {}; + return { + get: function() { + return { prepareGlobal: noop, retrieveGlobal: noop }; + }, + global: global, + __exec: function(__load) { + doEval(__load.source, global); + } + }; + }); +})( + {}, + typeof self == "object" && self.Object == Object ? self : window, + function(__$source__, __$global__) { + // jshint ignore:line + eval("(function() { " + __$source__ + " \n }).call(__$global__);"); + } +); + +/*can-globals@0.2.5#can-globals-proto*/ +define('can-globals/can-globals-proto', [ + 'require', + 'exports', + 'module', + 'can-reflect' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var canReflect = require('can-reflect'); + function dispatch(key) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var handlersCopy = handlers.slice(); + var value = this.getKeyValue(key); + for (var i = 0; i < handlersCopy.length; i++) { + handlersCopy[i](value); + } + } + } + function Globals() { + this.eventHandlers = {}; + this.properties = {}; + } + Globals.prototype.define = function (key, value, enableCache) { + if (enableCache === undefined) { + enableCache = true; + } + if (!this.properties[key]) { + this.properties[key] = { + default: value, + value: value, + enableCache: enableCache + }; + } + return this; + }; + Globals.prototype.getKeyValue = function (key) { + var property = this.properties[key]; + if (property) { + if (typeof property.value === 'function') { + if (property.cachedValue) { + return property.cachedValue; + } + if (property.enableCache) { + property.cachedValue = property.value(); + return property.cachedValue; + } else { + return property.value(); + } + } + return property.value; + } + }; + Globals.prototype.makeExport = function (key) { + return function (value) { + if (arguments.length === 0) { + return this.getKeyValue(key); + } + if (typeof value === 'undefined' || value === null) { + this.deleteKeyValue(key); + } else { + if (typeof value === 'function') { + this.setKeyValue(key, function () { + return value; + }); + } else { + this.setKeyValue(key, value); + } + return value; + } + }.bind(this); + }; + Globals.prototype.offKeyValue = function (key, handler) { + if (this.properties[key]) { + var handlers = this.eventHandlers[key]; + if (handlers) { + var i = handlers.indexOf(handler); + handlers.splice(i, 1); + } + } + return this; + }; + Globals.prototype.onKeyValue = function (key, handler) { + if (this.properties[key]) { + if (!this.eventHandlers[key]) { + this.eventHandlers[key] = []; + } + this.eventHandlers[key].push(handler); + } + return this; + }; + Globals.prototype.deleteKeyValue = function (key) { + var property = this.properties[key]; + if (property !== undefined) { + property.value = property.default; + property.cachedValue = undefined; + dispatch.call(this, key); + } + return this; + }; + Globals.prototype.setKeyValue = function (key, value) { + if (!this.properties[key]) { + return this.define(key, value); + } + var property = this.properties[key]; + property.value = value; + property.cachedValue = undefined; + dispatch.call(this, key); + return this; + }; + Globals.prototype.reset = function () { + for (var key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + this.properties[key].value = this.properties[key].default; + this.properties[key].cachedValue = undefined; + dispatch.call(this, key); + } + } + return this; + }; + canReflect.assignSymbols(Globals.prototype, { + 'can.getKeyValue': Globals.prototype.getKeyValue, + 'can.setKeyValue': Globals.prototype.setKeyValue, + 'can.deleteKeyValue': Globals.prototype.deleteKeyValue, + 'can.onKeyValue': Globals.prototype.onKeyValue, + 'can.offKeyValue': Globals.prototype.offKeyValue + }); + module.exports = Globals; + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#can-globals-instance*/ +define('can-globals/can-globals-instance', [ + 'require', + 'exports', + 'module', + 'can-namespace', + 'can-globals/can-globals-proto' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var namespace = require('can-namespace'); + var Globals = require('can-globals/can-globals-proto'); + var globals = new Globals(); + if (namespace.globals) { + throw new Error('You can\'t have two versions of can-globals, check your dependencies'); + } else { + module.exports = namespace.globals = globals; + } + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#global/global*/ +define('can-globals/global/global', [ + 'require', + 'exports', + 'module', + 'can-globals/can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('can-globals/can-globals-instance'); + globals.define('global', function () { + return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : typeof process === 'object' && {}.toString.call(process) === '[object process]' ? global : window; + }); + module.exports = globals.makeExport('global'); + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#document/document*/ +define('can-globals/document/document', [ + 'require', + 'exports', + 'module', + 'can-globals/global/global', + 'can-globals/can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('can-globals/global/global'); + var globals = require('can-globals/can-globals-instance'); + globals.define('document', function () { + return globals.getKeyValue('global').document; + }); + module.exports = globals.makeExport('document'); + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#location/location*/ +define('can-globals/location/location', [ + 'require', + 'exports', + 'module', + 'can-globals/global/global', + 'can-globals/can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('can-globals/global/global'); + var globals = require('can-globals/can-globals-instance'); + globals.define('location', function () { + return globals.getKeyValue('global').location; + }); + module.exports = globals.makeExport('location'); + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#mutation-observer/mutation-observer*/ +define('can-globals/mutation-observer/mutation-observer', [ + 'require', + 'exports', + 'module', + 'can-globals/global/global', + 'can-globals/can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + require('can-globals/global/global'); + var globals = require('can-globals/can-globals-instance'); + globals.define('MutationObserver', function () { + var GLOBAL = globals.getKeyValue('global'); + return GLOBAL.MutationObserver || GLOBAL.WebKitMutationObserver || GLOBAL.MozMutationObserver; + }); + module.exports = globals.makeExport('MutationObserver'); + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#is-browser-window/is-browser-window*/ +define('can-globals/is-browser-window/is-browser-window', [ + 'require', + 'exports', + 'module', + 'can-globals/can-globals-instance' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('can-globals/can-globals-instance'); + globals.define('isBrowserWindow', function () { + return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof SimpleDOM === 'undefined'; + }); + module.exports = globals.makeExport('isBrowserWindow'); + }(function () { + return this; + }())); +}); +/*can-globals@0.2.5#can-globals*/ +define('can-globals', [ + 'require', + 'exports', + 'module', + 'can-globals/can-globals-instance', + 'can-globals/global/global', + 'can-globals/document/document', + 'can-globals/location/location', + 'can-globals/mutation-observer/mutation-observer', + 'can-globals/is-browser-window/is-browser-window' +], function (require, exports, module) { + (function (global) { + 'use strict'; + var globals = require('can-globals/can-globals-instance'); + require('can-globals/global/global'); + require('can-globals/document/document'); + require('can-globals/location/location'); + require('can-globals/mutation-observer/mutation-observer'); + require('can-globals/is-browser-window/is-browser-window'); + module.exports = globals; + }(function () { + return this; + }())); +}); +/*[global-shim-end]*/ +(function(global) { // jshint ignore:line + global._define = global.define; + global.define = global.define.orig; +} +)(typeof self == "object" && self.Object == Object ? self : window); \ No newline at end of file