Skip to content

Commit e9f4ecc

Browse files
committed
strict mode: No 'with' statements allowed.
1 parent 8f790df commit e9f4ecc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jsparse.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,8 @@ static js_Ast *statement(js_State *J)
760760
}
761761

762762
if (jsP_accept(J, TK_WITH)) {
763+
if (J->strict)
764+
jsP_error(J, "'with' statements are not allowed in strict mode");
763765
jsP_expect(J, '(');
764766
a = expression(J, 0);
765767
jsP_expect(J, ')');

0 commit comments

Comments
 (0)