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

Unified Diff: test/mjsunit/regress/regress-186.js

Issue 18044: Fix issue 186:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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 | « test/mjsunit/bugs/bug-186.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-186.js
===================================================================
--- test/mjsunit/regress/regress-186.js (revision 1068)
+++ test/mjsunit/regress/regress-186.js (working copy)
@@ -33,14 +33,29 @@
var o = {};
o.__defineSetter__("x", function() { setterCalled = true; });
+function runTest(test) {
+ setterCalled = false;
+ test();
+}
+
function testLocal() {
// Add property called __proto__ to the extension object.
eval("var __proto__ = o");
// Check that the extension object's prototype did not change.
eval("var x = 27");
assertFalse(setterCalled, "prototype of extension object changed");
+ assertEquals(o, eval("__proto__"));
}
+function testConstLocal() {
+ // Add const property called __proto__ to the extension object.
+ eval("const __proto__ = o");
+ // Check that the extension object's prototype did not change.
+ eval("var x = 27");
+ assertFalse(setterCalled, "prototype of extension object changed");
+ assertEquals(o, eval("__proto__"));
+}
+
function testGlobal() {
// Assign to the global __proto__ property.
eval("__proto__ = o");
@@ -48,8 +63,10 @@
eval("x = 27");
assertTrue(setterCalled, "prototype of global object did not change");
setterCalled = false;
+ assertEquals(o, eval("__proto__"));
}
-testLocal();
-testGlobal();
+runTest(testLocal);
+runTest(testConstLocal);
+runTest(testGlobal);
« no previous file with comments | « test/mjsunit/bugs/bug-186.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698