Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: test/mjsunit/eval.js

Issue 6893057: Fix a bug in a corner case of direct eval detection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/eval.js
diff --git a/test/mjsunit/eval.js b/test/mjsunit/eval.js
index 25cfcb6231dcc7c94cfee81c17879a4187e4f7a2..b6284ba911dece6ee77f74a8b46a81b8bfa45927 100644
--- a/test/mjsunit/eval.js
+++ b/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);
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698