Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JsRunSerializedScriptWithCallback

Limin Zhu edited this pageMar 14, 2017 ·2 revisions

Runs a serialized script. Provides the ability to lazy load the script source only if/when it is needed.

Syntax

STDAPI_(JsErrorCode)    JsRunSerializedScriptWithCallback(    _In_ JsSerializedScriptLoadSourceCallback scriptLoadCallback,    _In_ JsSerializedScriptUnloadCallback scriptUnloadCallback,    _In_ BYTE *buffer,    _In_ JsSourceContext sourceContext,    _In_z_ const wchar_t *sourceUrl,    _Out_opt_ JsValueRef * result);

Parameters

  • scriptLoadCallback: Callback called when the source code of the script needs to be loaded.
  • scriptUnloadCallback: Callback called when the serialized script and source code are no longer needed.
  • buffer: The serialized script.
  • sourceContext: A cookie identifying the script that can be used by debuggable script contexts. This context will passed into scriptLoadCallback and scriptUnloadCallback.
  • sourceUrl: The location the script came from.
  • result: The result of running the script, if any. This parameter can be null.

Return Value

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

Remarks

This API is Windows-only (seeJsRunSerialized for cross-platform equivalent).Requires an active script context.The runtime will hold on to the buffer until all instances of any functions created fromthe buffer are garbage collected. It will then call scriptUnloadCallback to inform thecaller it is safe to release.

Want to contribute to this Wiki?

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp