summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/eval.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/eval.js')
-rw-r--r--deps/v8/test/mjsunit/eval.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/eval.js b/deps/v8/test/mjsunit/eval.js
index 25cfcb6231..b6284ba911 100644
--- a/deps/v8/test/mjsunit/eval.js
+++ b/deps/v8/test/mjsunit/eval.js
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -155,3 +155,12 @@ result =
return (function() { return eval(2); })();
})();
assertEquals(4, result);
+
+// Regression test: calling a function named eval found in a context that is
+// not the global context should get the global object as receiver.
+result =
+ (function () {
+ var eval = function (x) { return this; };
+ with ({}) { return eval('ignore'); }
+ })();
+assertEquals(this, result);