Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit d140a8c

Browse files
committed
Ensure strictmode is enabled/disabled when changing sourceType (#302)
1 parent 4cfc1e2 commit d140a8c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/non-regression.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,23 @@ describe("verify", function () {
14281428
);
14291429
});
14301430

1431+
it("with does not crash parsing in script mode (strict off) #171", function () {
1432+
verifyAndAssertMessages(
1433+
"with (arguments) { length; }",
1434+
{},
1435+
[],
1436+
"script"
1437+
);
1438+
});
1439+
1440+
it("with does crash parsing in module mode (strict on) #171", function () {
1441+
verifyAndAssertMessages(
1442+
"with (arguments) { length; }",
1443+
{},
1444+
[ "1:1 Parsing error: 'with' in strict mode" ]
1445+
);
1446+
});
1447+
14311448
// it("regex with es6 unicodeCodePointEscapes", function () {
14321449
// verifyAndAssertMessages(
14331450
// "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);",

0 commit comments

Comments
 (0)