From e31263b21051fd030c2c99c1853e8b9be4097edf Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 25 Apr 2016 15:38:00 +0200 Subject: [PATCH] Ensure strictmode is enabled/disabled when changing sourceType --- test/non-regression.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/non-regression.js b/test/non-regression.js index f88ba58c..593cc492 100644 --- a/test/non-regression.js +++ b/test/non-regression.js @@ -1428,6 +1428,23 @@ describe("verify", function () { ); }); + it("with does not crash parsing in script mode (strict off) #171", function () { + verifyAndAssertMessages( + "with (arguments) { length; }", + {}, + [], + "script" + ); + }); + + it("with does crash parsing in module mode (strict on) #171", function () { + verifyAndAssertMessages( + "with (arguments) { length; }", + {}, + [ "1:1 Parsing error: 'with' in strict mode" ] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",