A better fix for the IE bug. Rather than introduce the secondary global and the eval, just refer to the actual global object (works in any javascript env).

This commit is contained in:
Ross Boucher committed 2010-02-17 16:55:07 -08:00
1 parent 1328bc732f
commit d40619aca0
1 file changed
+2 -21
+2 -21
View File
@@ -1,27 +1,8 @@
var global = { },
ObjectiveJ = { };
var ObjectiveJ = { };
(function (global, exports, namespace)
{
var GLOBAL_NAMESPACE = namespace;
#include "Includes.js"
})(global, ObjectiveJ, window);
})((function(){return this;}).call(null), ObjectiveJ);
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];
}