@@ -30,6 +30,7 @@ CHAKRA_API RunScriptWithParserStateCore(
30
30
_In_ WCHAR *url,
31
31
_In_ JsParseScriptAttributes parseAttributes,
32
32
_In_ JsValueRef parserState,
33
+ _In_ bool parseOnly,
33
34
_Out_ JsValueRef *result
34
35
);
35
36
@@ -5370,7 +5371,6 @@ CHAKRA_API JsSerializeParserState(
5370
5371
return errorCode;
5371
5372
}
5372
5373
5373
-
5374
5374
static bool CHAKRA_CALLBACK DummyScriptLoadSourceCallbackForRunScriptWithParserState (
5375
5375
JsSourceContext sourceContext,
5376
5376
_Out_ JsValueRef *value,
@@ -5388,6 +5388,7 @@ CHAKRA_API RunScriptWithParserStateCore(
5388
5388
_In_ WCHAR *url,
5389
5389
_In_ JsParseScriptAttributes parseAttributes,
5390
5390
_In_ JsValueRef parserState,
5391
+ _In_ bool parseOnly,
5391
5392
_Out_ JsValueRef *result
5392
5393
)
5393
5394
{
@@ -5480,7 +5481,7 @@ CHAKRA_API RunScriptWithParserStateCore(
5480
5481
return RunSerializedScriptCore (
5481
5482
dummy, DummyScriptUnloadCallback,
5482
5483
sourceContext, // use the same user provided sourceContext as scriptLoadSourceContext
5483
- buffer, arrayBuffer, sourceContext, url, dwBgParseCookie, false , true , result, sourceIndex);
5484
+ buffer, arrayBuffer, sourceContext, url, dwBgParseCookie, parseOnly , true , result, sourceIndex);
5484
5485
}
5485
5486
5486
5487
CHAKRA_API JsRunScriptWithParserState (
@@ -5495,14 +5496,33 @@ CHAKRA_API JsRunScriptWithParserState(
5495
5496
if (sourceUrl && Js::VarIs<Js::JavascriptString>(sourceUrl))
5496
5497
{
5497
5498
url = const_cast <WCHAR*>(((Js::JavascriptString*)(sourceUrl))->GetSz ());
5498
- return RunScriptWithParserStateCore (0 , script, sourceContext, url, parseAttributes, parserState, result);
5499
+ return RunScriptWithParserStateCore (0 , script, sourceContext, url, parseAttributes, parserState, false , result);
5499
5500
}
5500
5501
else
5501
5502
{
5502
5503
return JsErrorInvalidArgument;
5503
5504
}
5504
5505
}
5505
5506
5507
+ CHAKRA_API JsDeserializeParserState (
5508
+ _In_ JsValueRef script,
5509
+ _In_ JsSourceContext sourceContext,
5510
+ _In_ JsValueRef sourceUrl,
5511
+ _In_ JsParseScriptAttributes parseAttributes,
5512
+ _In_ JsValueRef parserState,
5513
+ _Out_ JsValueRef * result)
5514
+ {
5515
+ WCHAR *url = nullptr ;
5516
+ if (sourceUrl && Js::VarIs<Js::JavascriptString>(sourceUrl))
5517
+ {
5518
+ url = const_cast <WCHAR*>(((Js::JavascriptString*)(sourceUrl))->GetSz ());
5519
+ return RunScriptWithParserStateCore (0 , script, sourceContext, url, parseAttributes, parserState, true , result);
5520
+ }
5521
+ else
5522
+ {
5523
+ return JsErrorInvalidArgument;
5524
+ }
5525
+ }
5506
5526
5507
5527
CHAKRA_API
5508
5528
JsExecuteBackgroundParse_Experimental (
@@ -5524,6 +5544,7 @@ JsExecuteBackgroundParse_Experimental(
5524
5544
url,
5525
5545
parseAttributes,
5526
5546
parserState,
5547
+ false ,
5527
5548
result
5528
5549
);
5529
5550
}
0 commit comments