File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3834,11 +3834,13 @@ void ByteCodeGenerator::StartEmitFunction(ParseNode *pnodeFnc)
38343834
38353835 FuncInfo *funcInfo = pnodeFnc->sxFnc .funcInfo ;
38363836
3837- if (funcInfo->byteCodeFunction ->IsFunctionParsed () &&
3838- !(flags & (fscrEval | fscrImplicitThis | fscrImplicitParents)))
3837+ if (funcInfo->byteCodeFunction ->IsFunctionParsed ())
38393838 {
3840- // Only set the environment depth if it's truly known (i.e., not in eval or event handler).
3841- funcInfo->GetParsedFunctionBody ()->SetEnvDepth (this ->envDepth );
3839+ if (!(flags & (fscrEval | fscrImplicitThis | fscrImplicitParents)))
3840+ {
3841+ // Only set the environment depth if it's truly known (i.e., not in eval or event handler).
3842+ funcInfo->GetParsedFunctionBody ()->SetEnvDepth (this ->envDepth );
3843+ }
38423844
38433845 if (pnodeFnc->sxFnc .FIBPreventsDeferral ())
38443846 {
Original file line number Diff line number Diff line change 1+ //-------------------------------------------------------------------------------------------------------
2+ // Copyright (C) Microsoft. All rights reserved.
3+ // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+ //-------------------------------------------------------------------------------------------------------
5+
6+ eval (
7+ 'function outer() {' +
8+ ' var f = "f";' +
9+ ' if (true) {' +
10+ ' let o = { x : function() { if (f !== "f") { WScript.Echo("fail"); throw 1; } } };' +
11+ ' function i() {}' +
12+ ' o.x();' +
13+ ' }' +
14+ '}' ) ;
15+
16+ for ( var i = 0 ; i < 100 ; i ++ )
17+ arr = [ 10000 ] ;
18+ outer ( ) ;
19+ WScript . Echo ( 'pass' ) ;
Original file line number Diff line number Diff line change 443443 <baseline >redefer-recursive-inlinees.baseline</baseline >
444444 </default >
445445 </test >
446+ <test >
447+ <default >
448+ <files >redefer-f-i-b-eval.js</files >
449+ <compile-flags >-force:deferparse -force:redeferral</compile-flags >
450+ </default >
451+ </test >
446452</regress-exe >
You can’t perform that action at this time.
0 commit comments