diff --git a/Objective-J/Browser/Objective-J.js b/Objective-J/Browser/Objective-J.js index 733921b60..f2c48c0cf 100644 --- a/Objective-J/Browser/Objective-J.js +++ b/Objective-J/Browser/Objective-J.js @@ -1,8 +1,27 @@ -var ObjectiveJ = { }; +var global = { }, + ObjectiveJ = { }; (function (global, exports, namespace) { + var GLOBAL_NAMESPACE = namespace; #include "Includes.js" -})((function(){return this;}).call(null), ObjectiveJ); +})(global, ObjectiveJ, window); +var hasOwnProperty = Object.prototype.hasOwnProperty; + +// If we can't trust the host object, don't treat it as global +// and fall back to inferred global through eval. In IE this +// make a difference. +if (window.window !== window) +{ + for (key in global) + if (hasOwnProperty.call(global, key)) + eval(key + " = global[\"" + key + "\"];"); +} +else +{ + for (key in global) + if (hasOwnProperty.call(global, key)) + window[key] = global[key]; +}