Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move win.eval creating logic up

  • Loading branch information...
commit cf8f3ed43f12d361bf600f71e5b1d565493e3dd9 1 parent c369465
@substack authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 index.js
View
11 index.js
@@ -61,6 +61,12 @@ Script.prototype.runInContext = function (context) {
var win = iframe.contentWindow;
var wEval = win.eval, wExecScript = win.execScript;
+
+ if (!wEval && wExecScript) {
+ // win.eval() magically appears when this is called in IE:
+ wExecScript.call(win, 'null');
+ wEval = win.eval;
+ }
forEach(Object_keys(context), function (key) {
win[key] = context[key];
@@ -70,11 +76,6 @@ Script.prototype.runInContext = function (context) {
win[key] = context[key];
}
});
-
- if (!wEval && wExecScript) {
- // win.eval() magically appears when this is called in IE:
- wExecScript.call(win, 'null');
- }
var winKeys = Object_keys(win);
Please sign in to comment.
Something went wrong with that request. Please try again.