mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-18 20:49:22 +00:00
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:
1 parent
1328bc732f
commit
d40619aca0
1 file changed
+2
-21
@@ -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];
|
||||
}
|
||||
Reference in new issue
Block a user