Share via


JsCreateRuntime Function

Creates a new runtime.

Syntax

// Microsoft Edge mode signature  
STDAPI_(JsErrorCode) JsCreateRuntime(  
   _In_ JsRuntimeAttributes attributes,  
   _In_opt_ JsThreadServiceCallback threadService,  
   _Out_ JsRuntimeHandle *runtime);  
  
// Legacy mode signature  
STDAPI_(JsErrorCode) JsCreateRuntime(  
   _In_ JsRuntimeAttributes attributes,  
   _In_ JsRuntimeVersion version,  
   _In_opt_ JsThreadServiceCallback threadService,  
   _Out_ JsRuntimeHandle *runtime  
);  

Parameters

attributes
The attributes of the runtime to be created.

version
The version of the runtime to be created.

threadService
The thread service for the runtime. Can be null.

runtime
The runtime created.

Return Value

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

Remarks

The version parameter is not supported in Microsoft Edge mode. For more information on using this API in Microsoft Edge mode, see Targeting Microsoft Edge vs. Legacy Engines.

Requirements

Header: jsrt.h

See Also

Reference (JavaScript Runtime)