Chromium Code Reviews| Index: test/mjsunit/const-eval-init.js |
| diff --git a/test/mjsunit/const-eval-init.js b/test/mjsunit/const-eval-init.js |
| index d3503845d0c159f106fe7a68e95d41f14105413e..4bd2b188250d8819692e34e4747a50edf25fa095 100644 |
| --- a/test/mjsunit/const-eval-init.js |
| +++ b/test/mjsunit/const-eval-init.js |
| @@ -38,13 +38,13 @@ function testIntroduceGlobal() { |
| "delete x;" + |
| // Initialization turns into assignment to global 'x'. |
|
rossberg
2014/07/11 12:54:49
Adjust comment (also below)
Toon Verwaest
2014/07/14 07:39:55
Done.
|
| "const x = 3; assertEquals(3, x);" + |
| - // No constness of the global 'x'. |
| - "x = 4; assertEquals(4, x);"; |
| + // Test constness of the global 'x'. |
| + "x = 4; assertEquals(3, x);"; |
| eval(source); |
| } |
| testIntroduceGlobal(); |
| -assertEquals(4, x); |
| +assertEquals("undefined", typeof x); |
| function testAssignExistingGlobal() { |
| var source = |
| @@ -52,13 +52,13 @@ function testAssignExistingGlobal() { |
| "delete x;" + |
| // Initialization turns into assignment to global 'x'. |
| "const x = 5; assertEquals(5, x);" + |
| - // No constness of the global 'x'. |
| - "x = 6; assertEquals(6, x);"; |
| + // Test constness of the global 'x'. |
| + "x = 6; assertEquals(5, x);"; |
| eval(source); |
| } |
| testAssignExistingGlobal(); |
| -assertEquals(6, x); |
| +assertEquals("undefined", typeof x); |
| function testAssignmentArgument(x) { |
| function local() { |
| @@ -66,7 +66,7 @@ function testAssignmentArgument(x) { |
| eval(source); |
| } |
| local(); |
| - assertEquals(7, x); |
| + assertEquals("undefined", typeof x); |
| } |
| for (var i = 0; i < 5; i++) { |
| @@ -74,17 +74,19 @@ for (var i = 0; i < 5; i++) { |
| } |
| %OptimizeFunctionOnNextCall(testAssignmentArgument); |
| testAssignmentArgument(); |
| -assertEquals(6, x); |
| +assertEquals("undefined", typeof x); |
| __defineSetter__('x', function() { throw 42; }); |
| +var finished = false; |
| function testAssignGlobalThrows() { |
| // Initialization turns into assignment to global 'x' which |
| // throws an exception. |
| - var source = "delete x; const x = 8"; |
| + var source = "delete x; const x = 8; finished = true;"; |
| eval(source); |
| } |
| -assertThrows("testAssignGlobalThrows()"); |
| +testAssignGlobalThrows(); |
| +assertTrue(finished); |
| function testInitFastCaseExtension() { |
| var source = "const x = 9; assertEquals(9, x); x = 10; assertEquals(9, x)"; |
| @@ -111,7 +113,7 @@ function testAssignSurroundingContextSlot() { |
| eval(source); |
| } |
| local(); |
| - assertEquals(13, x); |
| + assertEquals(12, x); |
| } |
| testAssignSurroundingContextSlot(); |