Avoid unnecessarily creating Scope.

This commit is contained in:
Stephen Chung
2023-01-11 11:42:46 +08:00
parent 6d64a75bd2
commit ea3efe654c
10 changed files with 40 additions and 32 deletions

View File

@@ -60,7 +60,7 @@ impl Engine {
let ast = {
let (stream, tc) = self.lex_raw(&scripts, self.token_mapper.as_deref());
let interned_strings = &mut *locked_write(&self.interned_strings);
let state = &mut ParseState::new(scope, interned_strings, tc);
let state = &mut ParseState::new(Some(scope), interned_strings, tc);
self.parse(stream.peekable(), state, self.optimization_level)?
};
self.run_ast_with_scope(scope, &ast)