File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
graal-js/src/com.oracle.truffle.js.parser/src/com/oracle/truffle/js/parser Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3656,8 +3656,9 @@ public JavaScriptNode enterWithNode(com.oracle.js.parser.ir.WithNode withNode) {
36563656 if (context .isOptionDisableWith ()) {
36573657 throw Errors .createSyntaxError ("with statement is disabled." );
36583658 }
3659- // Store with object in synthetic block environment that can be captured by closures.
3660- Environment withParentEnv = lc .getCurrentFunction ().hasClosures () ? new BlockEnvironment (environment , factory , context ) : environment ;
3659+ // Store with object in synthetic block environment that can be captured by closures/eval.
3660+ FunctionNode function = lc .getCurrentFunction ();
3661+ Environment withParentEnv = (function .hasClosures () || function .hasEval ()) ? new BlockEnvironment (environment , factory , context ) : environment ;
36613662 try (EnvironmentCloseable withParent = new EnvironmentCloseable (withParentEnv )) {
36623663 JavaScriptNode withExpression = transform (withNode .getExpression ());
36633664 JavaScriptNode toObject = factory .createToObjectFromWith (context , withExpression , true );
You can’t perform that action at this time.
0 commit comments