Index: src/v8natives.js |
=================================================================== |
--- src/v8natives.js (revision 754) |
+++ src/v8natives.js (working copy) |
@@ -105,6 +105,11 @@ |
function GlobalEval(x) { |
if (!IS_STRING(x)) return x; |
+ if (this !== %GlobalReceiver(global)) { |
+ throw $EvalError('The "this" object passed to eval ' + |
+ 'must be the global object from which eval originated'); |
+ } |
+ |
var f = %CompileString(x, 0, true); |
if (!IS_FUNCTION(f)) return f; |