Don't allow with statements in strict mode

This commit is contained in:
Anthony Van de Gejuchte
2016-06-12 18:58:20 +02:00
parent 6c8e001fee
commit bb9c9707aa
2 changed files with 19 additions and 0 deletions

View File

@@ -928,6 +928,9 @@ function parse($TEXT, options) {
return tmp = const_(), semicolon(), tmp;
case "with":
if (S.input.has_directive("use strict")) {
croak("Strict mode may not include a with statement");
}
return new AST_With({
expression : parenthesised(),
body : statement()