Allow scope constants in strict variables mode.

This commit is contained in:
Stephen Chung
2022-04-21 13:21:53 +08:00
parent c3d013bddc
commit 6b8ddd925b
7 changed files with 44 additions and 28 deletions

View File

@@ -24,12 +24,11 @@ impl Engine {
let scripts = [script];
let (stream, tokenizer_control) =
self.lex_raw(&scripts, self.token_mapper.as_ref().map(Box::as_ref));
let mut state = ParseState::new(self, tokenizer_control);
let mut state = ParseState::new(self, scope, tokenizer_control);
let ast = self.parse(
&mut stream.peekable(),
&mut state,
scope,
self.options.optimization_level,
)?;