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); |