Skip to content

Commit 671469b

Browse files
author
Thomas Moore (CHAKRA)
committed
Move the call to RunBgParseSync inside RunScript to reuse other setup done to execute a script.
1 parent cc39044 commit 671469b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bin/ch/WScriptJsrt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class WScriptJsrt
8989
return _u("FatalError");
9090
case (JsErrorCode::JsErrorInExceptionState) :
9191
return _u("ErrorInExceptionState");
92+
case (JsErrorCode::JsErrorBadSerializedScript):
93+
return _u("ErrorBadSerializedScript ");
9294
default:
9395
AssertMsg(false, "Unexpected JsErrorCode");
9496
return nullptr;

bin/ch/ch.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,11 @@ HRESULT RunScript(const char* fileName, LPCSTR fileContents, size_t fileLength,
458458
{
459459
runScript = WScriptJsrt::ModuleEntryPoint(fileName, fileContents, fullPath);
460460
}
461+
else if (HostConfigFlags::flags.ExecuteWithBgParse && !HostConfigFlags::flags.DebugLaunch)
462+
{
463+
unsigned int lengthBytes = (unsigned int) fileLength;
464+
runScript = (JsErrorCode)RunBgParseSync(fileContents, lengthBytes, fileName);
465+
}
461466
else // bufferValue == nullptr && parserStateCache == nullptr
462467
{
463468
JsValueRef scriptSource;
@@ -956,10 +961,6 @@ HRESULT ExecuteTest(const char* fileName)
956961
{
957962
CreateParserStateAndRunScript(fileName, fileContents, lengthBytes, WScriptJsrt::FinalizeFree, fullPath);
958963
}
959-
else if (HostConfigFlags::flags.ExecuteWithBgParse)
960-
{
961-
RunBgParseSync(fileContents, lengthBytes, fileName);
962-
}
963964
else
964965
{
965966
IfFailGo(RunScript(fileName, fileContents, lengthBytes, WScriptJsrt::FinalizeFree, nullptr, fullPath, nullptr));

0 commit comments

Comments
 (0)