Skip to content

Commit 1e14bd7

Browse files
committed
[MERGE #5234 @pleath] OS#14915011: Force deferred parsing off under F12 console eval
Merge pull request #5234 from pleath:14915011 We used to disable deferral and redeferral of console eval expressions based on their length. Short scripts now allow redeferral, which requires creation of scope info, which in turn doesn't work under console eval. Simply forcing deferral off in this scenario.
2 parents 776504e + e30cab3 commit 1e14bd7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Runtime/Library/GlobalObject.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,18 @@ 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 | fscrCanDeferFncParse;
604+
uint32 grfscr = additionalGrfscr | fscrReturnExpression | fscrEval | fscrEvalCode | fscrGlobalCode;
605605

606606
if (isLibraryCode)
607607
{
608608
grfscr |= fscrIsLibraryCode;
609609
}
610610

611+
if (!(grfscr & fscrConsoleScopeEval))
612+
{
613+
grfscr |= fscrCanDeferFncParse;
614+
}
615+
611616
pfuncScript = library->GetGlobalObject()->EvalHelper(scriptContext, argString->GetSz(), argString->GetLength(), moduleID,
612617
grfscr, Constants::EvalCode, doRegisterDocument, isIndirect, strictMode);
613618

0 commit comments

Comments
 (0)