Skip to content

Commit a518668

Browse files
committed
[MERGE #5223 @pleath] Re-enable deferral of functions declared in eval
Merge pull request #5223 from pleath:code-load The change to deferral heuristics accidentally disabled this by not passing the proper flags to the parser.
2 parents df8f38b + e872810 commit a518668

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Runtime/Library/GlobalObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ namespace Js
601601
bool found = useEvalMap && scriptContext->IsInEvalMap(key, isIndirect, &pfuncScript);
602602
if (!found || (!isIndirect && pfuncScript->GetEnvironment() != &NullFrameDisplay))
603603
{
604-
uint32 grfscr = additionalGrfscr | fscrReturnExpression | fscrEval | fscrEvalCode | fscrGlobalCode;
604+
uint32 grfscr = additionalGrfscr | fscrReturnExpression | fscrEval | fscrEvalCode | fscrGlobalCode | fscrCanDeferFncParse;
605605

606606
if (isLibraryCode)
607607
{

lib/Runtime/Library/JavascriptFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ namespace Js
224224
&Parser::ValidateSourceElementList);
225225
}
226226

227-
pfuncScript = scriptContext->GetGlobalObject()->EvalHelper(scriptContext, sourceString, sourceLen, moduleID, fscrNil, Constants::FunctionCode, TRUE, TRUE, strictMode);
227+
pfuncScript = scriptContext->GetGlobalObject()->EvalHelper(scriptContext, sourceString, sourceLen, moduleID, fscrCanDeferFncParse, Constants::FunctionCode, TRUE, TRUE, strictMode);
228228

229229
// Indicate that this is a top-level function. We don't pass the fscrGlobalCode flag to the eval helper,
230230
// or it will return the global function that wraps the declared function body, as though it were an eval.

0 commit comments

Comments
 (0)