| Index: test/mjsunit/harmony/block-let-semantics.js
|
| ===================================================================
|
| --- test/mjsunit/harmony/block-let-semantics.js (revision 9808)
|
| +++ test/mjsunit/harmony/block-let-semantics.js (working copy)
|
| @@ -61,6 +61,7 @@
|
| TestAll('let x = x += 1');
|
| TestAll('let x = x++');
|
| TestAll('let x = ++x');
|
| +TestAll('const x = x + 1');
|
|
|
| // Use before initialization in prior statement.
|
| TestAll('x + 1; let x;');
|
| @@ -68,18 +69,21 @@
|
| TestAll('x += 1; let x;');
|
| TestAll('++x; let x;');
|
| TestAll('x++; let x;');
|
| +TestAll('let y = x; const x = 1;');
|
|
|
| TestAll('f(); let x; function f() { return x + 1; }');
|
| TestAll('f(); let x; function f() { x = 1; }');
|
| TestAll('f(); let x; function f() { x += 1; }');
|
| TestAll('f(); let x; function f() { ++x; }');
|
| TestAll('f(); let x; function f() { x++; }');
|
| +TestAll('f(); const x = 1; function f() { return x; }');
|
|
|
| TestAll('f()(); let x; function f() { return function() { return x + 1; } }');
|
| TestAll('f()(); let x; function f() { return function() { x = 1; } }');
|
| TestAll('f()(); let x; function f() { return function() { x += 1; } }');
|
| TestAll('f()(); let x; function f() { return function() { ++x; } }');
|
| TestAll('f()(); let x; function f() { return function() { x++; } }');
|
| +TestAll('f()(); const x = 1; function f() { return function() { return x; } }');
|
|
|
| // Use before initialization with a dynamic lookup.
|
| TestAll('eval("x + 1;"); let x;');
|
| @@ -87,6 +91,7 @@
|
| TestAll('eval("x += 1;"); let x;');
|
| TestAll('eval("++x;"); let x;');
|
| TestAll('eval("x++;"); let x;');
|
| +TestAll('eval("x"); const x = 1;');
|
|
|
| // Use before initialization with check for eval-shadowed bindings.
|
| TestAll('function f() { eval("var y = 2;"); x + 1; }; f(); let x;');
|
| @@ -139,10 +144,31 @@
|
| function h() {
|
| return b + c;
|
| }
|
| - let b = 3;
|
| + let c = 3;
|
| }
|
| assertEquals(5, n());
|
| +
|
| + {
|
| + o = i;
|
| + function i() {
|
| + return d;
|
| + }
|
| + let d = 4;
|
| + }
|
| + assertEquals(4, o());
|
| +
|
| + try {
|
| + throw 5;
|
| + } catch(e) {
|
| + p = j;
|
| + function j() {
|
| + return e + f;
|
| + }
|
| + let f = 6;
|
| + }
|
| + assertEquals(11, p());
|
| }
|
| +f2();
|
|
|
| // Test that resolution of let bound variables works with scopes that call eval.
|
| function outer() {
|
|
|