Partager via


JsParseSerializedScript Function

Parses a serialized script and returns a function representing the script.

Syntax

STDAPI_(JsErrorCode) JsParseSerializedScript(  
   _In_z_ const wchar_t *script,  
   _In_ BYTE *buffer,  
   _In_ JsSourceContext sourceContext,  
   _In_z_ const wchar_t *sourceUrl,  
   _Out_ JsValueRef *result  
);  

Parameters

script
The script to parse.

buffer
The serialized script.

sourceContext
A cookie identifying the script that can be used by debuggable script contexts.

sourceUrl
The location the script came from.

result
A function representing the script code.

Return Value

The code JsNoError if the operation succeeded, a failure code otherwise.

Remarks

Requires an active script context.

The buffer is not persisted in memory by the scripting engine, so your code must keep it alive for as long as it might be used to execute scripts.

Requirements

Header: jsrt.h

See Also

Reference (JavaScript Runtime)