| Index: test/mjsunit/harmony/block-let-crankshaft.js
|
| diff --git a/test/mjsunit/regress/regress-1110.js b/test/mjsunit/harmony/block-let-crankshaft.js
|
| similarity index 73%
|
| copy from test/mjsunit/regress/regress-1110.js
|
| copy to test/mjsunit/harmony/block-let-crankshaft.js
|
| index 204a87ba3d16743a945fb2fb5817538fd43e7315..c2fb96b6a48ea6eb432595ef0591b9939a60f8f5 100644
|
| --- a/test/mjsunit/regress/regress-1110.js
|
| +++ b/test/mjsunit/harmony/block-let-crankshaft.js
|
| @@ -25,14 +25,39 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Test that the illegal continue is thrown at parse time.
|
| +// Flags: --harmony-block-scoping --allow-natives-syntax
|
| +
|
| +// Test that temporal dead zone semantics for function and block scoped
|
| +// ket bindings are handled by the optimizing compiler.
|
| +
|
| +function f(x, b) {
|
| + let y = (b ? y : x) + 42;
|
| + return y;
|
| +}
|
| +
|
| +function g(x, b) {
|
| + {
|
| + let y = (b ? y : x) + 42;
|
| + return y;
|
| + }
|
| +}
|
| +
|
| +for (var i=0; i<10; i++) {
|
| + f(i, false);
|
| + g(i, false);
|
| +}
|
| +
|
| +%OptimizeFunctionOnNextCall(f);
|
| +%OptimizeFunctionOnNextCall(g);
|
| +
|
| +try {
|
| + f(42, true);
|
| +} catch (e) {
|
| + assertInstanceof(e, ReferenceError);
|
| +}
|
|
|
| try {
|
| - function Crash() { continue;if (Crash) {
|
| - } }
|
| - Crash();
|
| - assertTrue(false);
|
| + g(42, true);
|
| } catch (e) {
|
| - assertTrue(e instanceof SyntaxError);
|
| - assertTrue(/continue/.test(e.message));
|
| + assertInstanceof(e, ReferenceError);
|
| }
|
|
|