ClearScript.V8 Defines caching options for V8 script compilation. Specifies that no cache data is to be generated or consumed during V8 script compilation. This option results in the most efficient script compilation when no cache data is available. Selects parser caching. Parser cache data is smaller and less expensive to generate than code cache data, but it is less effective at accelerating recompilation. Selects code caching. Code cache data is larger and more expensive to generate than parser cache data, but it is more effective at accelerating recompilation. Represents a V8 CPU profile. Gets the profile's name. Gets the profile's starting timestamp in microseconds. The timestamp specifies an offset relative to an unspecified moment in the past. All timestamps within the profile are relative to the same moment. Gets the profile's ending timestamp in microseconds. The timestamp specifies an offset relative to an unspecified moment in the past. All timestamps within the profile are relative to the same moment. Gets the root node of the profile's call tree. Gets the profile's sample collection. This property returns null if the profile contains no samples. Returns a JSON representation of the profile. See the V8 Inspector JSON Protocol for schema details. A JSON representation of the profile in V8 Inspector format. Writes a JSON representation of the profile to the given text writer. The text writer to which to write the profile. See the V8 Inspector JSON Protocol for schema details. Represents a node in a V8 CPU profile's call tree. Gets the node's numeric identifier. This value is unique within the profile. Gets the numeric identifier of the document containing the node's script function. Gets the name or URL of the document containing the node's script function. Gets the name of the node's script function. Gets the 1-based line number of the start of the node's script function. A value of zero indicates that no line number is available. Gets the 1-based column number of the start of the node's script function. A value of zero indicates that no column number is available. Gets the node's hit count. This value represents the number of times the CPU profiler observed the node's script function at the top of the call stack. Gets an optional string describing the reason why the node's script function was not optimized. Gets the node's hit line collection. This property returns null if the node contains no hit lines. Gets the node's child node collection. This property returns null if the node has no child nodes. Represents a script line observed by the V8 CPU profiler. Gets the 1-based line number. Gets the hit count for the script line. This value represents the number of times the CPU profiler observed the current script line at the top of the call stack. Represents a V8 CPU profile sample. Gets the sample's node within the profile's call tree. Gets the sample's timestamp in microseconds. The timestamp specifies an offset relative to an unspecified moment in the past. All timestamps within the profile are relative to the same moment. Defines options for creating a V8 CPU profile. Specifies that no options are selected. Specifies that automatic sample collection is to be enabled. Defines global V8 options. Specifies that no options are selected. Specifies that Top-Level Await is to be enabled. Specifies that just-in-time compilation is to be disabled. Specifies that background work is to be disabled. By default, V8 performs various tasks in the background, accelerating garbage collection, just-in-time compilation, and other activities. Use this option if you encounter issues related to V8's background work. Represents an instance of the V8 runtime. Initializes a new V8 runtime instance. Initializes a new V8 runtime instance with the specified name. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Initializes a new V8 runtime instance with the specified resource constraints. Resource constraints for the instance. Initializes a new V8 runtime instance with the specified name and resource constraints. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the instance. Initializes a new V8 runtime instance with the specified options. A value that selects options for the operation. Initializes a new V8 runtime instance with the specified options and debug port. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. Initializes a new V8 runtime instance with the specified name and options. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. Initializes a new V8 runtime instance with the specified name, options, and debug port. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. Initializes a new V8 runtime instance with the specified resource constraints and options. Resource constraints for the instance. A value that selects options for the operation. Initializes a new V8 runtime instance with the specified resource constraints, options, and debug port. Resource constraints for the instance. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. Initializes a new V8 runtime instance with the specified name, resource constraints, and options. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the instance. A value that selects options for the operation. Initializes a new V8 runtime instance with the specified name, resource constraints, options, and debug port. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the instance. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. Gets the name associated with the V8 runtime instance. Enables or disables script code formatting. When this property is set to true, the V8 runtime may format script code before executing or compiling it. This is intended to facilitate interactive debugging. The formatting operation currently includes stripping leading and trailing blank lines and removing global indentation. Gets or sets a soft limit for the size of the V8 runtime's heap. This property is specified in bytes. When it is set to the default value, heap size monitoring is disabled, and scripts with memory leaks or excessive memory usage can cause unrecoverable errors and process termination. A V8 runtime unconditionally terminates the process when it exceeds its resource constraints (see ). This property enables external heap size monitoring that can prevent termination in some scenarios. To be effective, it should be set to a value that is significantly lower than . Note that enabling heap size monitoring results in slower script execution. Exceeding this limit causes the V8 runtime to interrupt script execution and throw an exception. To re-enable script execution, set this property to a new value. Note that ArrayBuffer memory is allocated outside the runtime's heap and is therefore not tracked by heap size monitoring. See for additional information. Gets or sets the minimum time interval between consecutive heap size samples. This property is effective only when heap size monitoring is enabled (see ). Gets or sets the maximum amount by which the stack is permitted to grow during script execution. This property is specified in bytes. When it is set to the default value, no stack usage limit is enforced, and scripts with unchecked recursion or other excessive stack usage can cause unrecoverable errors and process termination. Note that the V8 runtime does not monitor stack usage while a host call is in progress. Monitoring is resumed when control returns to the runtime. Gets or sets the V8 runtime's document settings. Enables or disables interrupt propagation in the V8 runtime. By default, when nested script execution is interrupted via , an instance of , if not handled by the host, is wrapped and delivered to the parent script frame as a normal exception that JavaScript code can catch. Setting this property to true causes the V8 runtime to remain in the interrupted state until its outermost script frame has been processed. Creates a new V8 script engine instance. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. Creates a new V8 script engine instance with the specified name. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. Creates a new V8 script engine instance with the specified options. A value that selects options for the operation. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. V8 supports one script debugger per runtime. If script debugging has been enabled in the current runtime, additional script engine instances cannot disable it or change its TCP port, nor can they enable script debugging on a different port. Creates a new V8 script engine instance with the specified options and debug port. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. V8 supports one script debugger per runtime. If script debugging has been enabled in the current runtime, additional script engine instances cannot disable it or change its TCP port, nor can they enable script debugging on a different port. Creates a new V8 script engine instance with the specified name and options. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. V8 supports one script debugger per runtime. If script debugging has been enabled in the current runtime, additional script engine instances cannot disable it or change its TCP port, nor can they enable script debugging on a different port. Creates a new V8 script engine instance with the specified name, options, and debug port. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A new V8 script engine instance. The new script engine instance shares the V8 runtime with other instances created by this method and any of its overloads. V8 supports one script debugger per runtime. If script debugging has been enabled in the current runtime, additional script engine instances cannot disable it or change its TCP port, nor can they enable script debugging on a different port. Creates a compiled script. The script code to compile. A compiled script that can be executed by multiple V8 script engine instances. Creates a compiled script with an associated document name. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. A compiled script that can be executed by multiple V8 script engine instances. Creates a compiled script with the specified document meta-information. A structure containing meta-information for the script document. The script code to compile. A compiled script that can be executed by multiple V8 script engine instances. Creates a compiled script, generating cache data for accelerated recompilation. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Creates a compiled script with an associated document name, generating cache data for accelerated recompilation. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Creates a compiled script with the specified document meta-information, generating cache data for accelerated recompilation. A structure containing meta-information for the script document. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Creates a compiled script, consuming previously generated cache data. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Creates a compiled script with an associated document name, consuming previously generated cache data. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Creates a compiled script with the specified document meta-information, consuming previously generated cache data. A structure containing meta-information for the script document. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a script document. A string specifying the document to be loaded and compiled. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a document with the specified category. A string specifying the document to be loaded and compiled. An optional category for the requested document. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a document with the specified category and context callback. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a script document, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a document with the specified category, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. An optional category for the requested document. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a document with the specified category and context callback, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a script document, consuming previously generated cache data. A string specifying the document to be loaded and compiled. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a document with the specified category, consuming previously generated cache data. A string specifying the document to be loaded and compiled. An optional category for the requested document. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a document with the specified category and context callback, consuming previously generated cache data. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Returns memory usage information. A object containing memory usage information. Performs garbage collection. True to perform exhaustive garbage collection, false to favor speed over completeness. Begins collecting a new CPU profile. A name for the profile. True if the profile was created successfully, false otherwise. A V8 runtime can collect multiple CPU profiles simultaneously. Begins collecting a new CPU profile with the specified options. A name for the profile. Options for creating the profile. True if the profile was created successfully, false otherwise. A V8 runtime can collect multiple CPU profiles simultaneously. Completes and returns a CPU profile. The name of the profile. The profile if it was found and completed successfully, null otherwise. An empty argument selects the most recently created CPU profile. Collects a sample in all CPU profiles active in the V8 runtime. Gets or sets the time interval between automatic CPU profile samples, in microseconds. Assigning this property has no effect on CPU profiles already active in the V8 runtime. The default value is 1000. Writes a heap snapshot to the given stream. The stream to which to write the heap snapshot. This method generates a heap snapshot in JSON format with ASCII encoding. Releases all resources used by the V8 runtime. Call Dispose() when you are finished using the V8 runtime. Dispose() leaves the V8 runtime in an unusable state. After calling Dispose(), you must release all references to the V8 runtime so the garbage collector can reclaim the memory that the V8 runtime was occupying. Specifies resource constraints for a V8 runtime. Initializes a new instance. Gets or sets the maximum size of the new object heap in MiB. For maximum compatibility with hosts that predate an inadvertent breaking change in ClearScript 5.4.1, values greater than 1048576 (1 TiB) are assumed to be in bytes rather than MiB. For example, the values 16 and 16777216 both specify a limit of 16 MiB. Gets or sets the maximum size of the old object heap in MiB. For maximum compatibility with hosts that predate an inadvertent breaking change in ClearScript 5.4.1, values greater than 1048576 (1 TiB) are assumed to be in bytes rather than MiB. For example, the values 16 and 16777216 both specify a limit of 16 MiB. Gets or sets the maximum size of the executable code heap in MiB. For maximum compatibility with hosts that predate an inadvertent breaking change in ClearScript 5.4.1, values greater than 1048576 (1 TiB) are assumed to be in bytes rather than MiB. For example, the values 16 and 16777216 both specify a limit of 16 MiB. Gets or sets the maximum size of the young object heap in MiB. For maximum compatibility with hosts that predate an inadvertent breaking change in ClearScript 5.4.1, values greater than 1048576 (1 TiB) are assumed to be in bytes rather than MiB. For example, the values 16 and 16777216 both specify a limit of 16 MiB. Gets or sets the heap expansion multiplier. When set to a value greater than 1, this property enables on-demand heap expansion, which automatically increases the maximum heap size by the specified multiplier whenever the script engine is close to exceeding the current limit. Note that a buggy or malicious script can still cause an application to fail by exhausting its address space or total available memory. On-demand heap expansion is recommended for use in conjunction with heap size monitoring (see , ) to help contain runaway scripts. Gets or sets the maximum amount of ArrayBuffer memory the runtime may allocate. This property is specified in bytes. ArrayBuffer memory is allocated outside the runtime's heap and released when its garbage collector reclaims the corresponding JavaScript ArrayBuffer object. Leave this property at its default value to enforce no limit. Defines options for initializing a new V8 runtime instance. Specifies that no options are selected. Specifies that script debugging features are to be enabled. Specifies that remote script debugging is to be enabled. This option is ignored if is not specified. Specifies that dynamic module imports are to be enabled. This is an experimental feature and may be removed in a future release. Contains memory usage information for a V8 runtime. Gets the total heap size in bytes. Gets the total executable heap size in bytes. Gets the total physical memory size in bytes. Gets the used heap size in bytes. Gets the heap size limit in bytes. Represents a compiled script that can be executed multiple times without recompilation. Gets the document name associated with the compiled script. Gets the document meta-information for the compiled script. Releases all resources used by the compiled script. Call Dispose() when you are finished using the compiled script. Dispose() leaves the compiled script in an unusable state. After calling Dispose(), you must release all references to the compiled script so the garbage collector can reclaim the memory that the compiled script was occupying. Represents an instance of the V8 JavaScript engine. Unlike WindowsScriptEngine instances, V8ScriptEngine instances do not have thread affinity. The underlying script engine is not thread-safe, however, so this class uses internal locks to automatically serialize all script code execution for a given instance. Script delegates and event handlers are invoked on the calling thread without marshaling. Initializes a new V8 script engine instance. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified resource constraints. Resource constraints for the V8 runtime (see remarks). A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name and resource constraints. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the V8 runtime (see remarks). A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified options. A value that selects options for the operation. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified options and debug port. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name and options. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name, options, and debug port. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified resource constraints and options. Resource constraints for the V8 runtime (see remarks). A value that selects options for the operation. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified resource constraints, options, and debug port. Resource constraints for the V8 runtime (see remarks). A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name, resource constraints, and options. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the V8 runtime (see remarks). A value that selects options for the operation. A separate V8 runtime is created for the new script engine instance. Initializes a new V8 script engine instance with the specified name, resource constraints, options, and debug port. A name to associate with the instance. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. Resource constraints for the V8 runtime (see remarks). A value that selects options for the operation. A TCP port on which to listen for a debugger connection. A separate V8 runtime is created for the new script engine instance. Resumes script execution if the script engine is waiting for a debugger connection. This method can be called safely from any thread. Gets or sets a soft limit for the size of the V8 runtime's heap. This property is specified in bytes. When it is set to the default value, heap size monitoring is disabled, and scripts with memory leaks or excessive memory usage can cause unrecoverable errors and process termination. A V8 runtime unconditionally terminates the process when it exceeds its resource constraints (see ). This property enables external heap size monitoring that can prevent termination in some scenarios. To be effective, it should be set to a value that is significantly lower than . Note that enabling heap size monitoring results in slower script execution. Exceeding this limit causes the V8 runtime to interrupt script execution and throw an exception. To re-enable script execution, set this property to a new value. Note that ArrayBuffer memory is allocated outside the runtime's heap and is therefore not tracked by heap size monitoring. See for additional information. Gets or sets the minimum time interval between consecutive heap size samples. This property is effective only when heap size monitoring is enabled (see ). Gets or sets the maximum amount by which the V8 runtime is permitted to grow the stack during script execution. This property is specified in bytes. When it is set to the default value, no stack usage limit is enforced, and scripts with unchecked recursion or other excessive stack usage can cause unrecoverable errors and process termination. Note that the V8 runtime does not monitor stack usage while a host call is in progress. Monitoring is resumed when control returns to the runtime. Enables or disables instance method enumeration. By default, a host object's instance methods are exposed as enumerable properties. Setting this property to true causes instance methods to be excluded from property enumeration. This affects all host objects exposed in the current script engine. Note that instance methods remain both retrievable and invocable regardless of this property's value. Enables or disables extension method enumeration. By default, all exposed extension methods appear as enumerable properties of all host objects, regardless of type. Setting this property to true causes extension methods to be excluded from property enumeration. This affects all host objects exposed in the current script engine. Note that extension methods remain both retrievable and invocable regardless of this property's value. This property has no effect if is set to true. Enables or disables interrupt propagation in the V8 runtime. By default, when nested script execution is interrupted via , an instance of , if not handled by the host, is wrapped and delivered to the parent script frame as a normal exception that JavaScript code can catch. Setting this property to true causes the V8 runtime to remain in the interrupted state until its outermost script frame has been processed. Creates a compiled script. The script code to compile. A compiled script that can be executed multiple times without recompilation. Creates a compiled script with an associated document name. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. A compiled script that can be executed multiple times without recompilation. Creates a compiled script with the specified document meta-information. A structure containing meta-information for the script document. The script code to compile. A compiled script that can be executed multiple times without recompilation. Creates a compiled script, generating cache data for accelerated recompilation. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed multiple times without recompilation. The generated cache data can be stored externally and is usable in other V8 script engines and application processes. Creates a compiled script with an associated document name, generating cache data for accelerated recompilation. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed multiple times without recompilation. The generated cache data can be stored externally and is usable in other V8 script engines and application processes. Creates a compiled script with the specified document meta-information, generating cache data for accelerated recompilation. A structure containing meta-information for the script document. The script code to compile. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed multiple times without recompilation. The generated cache data can be stored externally and is usable in other V8 script engines and application processes. Creates a compiled script, consuming previously generated cache data. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed multiple times without recompilation. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Creates a compiled script with an associated document name, consuming previously generated cache data. A document name for the compiled script. Currently this name is used only as a label in presentation contexts such as debugger user interfaces. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed multiple times without recompilation. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Creates a compiled script with an associated document name, consuming previously generated cache data. A structure containing meta-information for the script document. The script code to compile. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed multiple times without recompilation. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a script document. A string specifying the document to be loaded and compiled. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a document with the specified category. A string specifying the document to be loaded and compiled. An optional category for the requested document. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a document with the specified category and context callback. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. A compiled script that can be executed by multiple V8 script engine instances. Loads and compiles a script document, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a document with the specified category, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. An optional category for the requested document. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a document with the specified category and context callback, generating cache data for accelerated recompilation. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. The kind of cache data to be generated. Cache data for accelerated recompilation. A compiled script that can be executed by multiple V8 script engine instances. The generated cache data can be stored externally and is usable in other V8 runtimes and application processes. Loads and compiles a script document, consuming previously generated cache data. A string specifying the document to be loaded and compiled. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a document with the specified category, consuming previously generated cache data. A string specifying the document to be loaded and compiled. An optional category for the requested document. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Loads and compiles a document with the specified category and context callback, consuming previously generated cache data. A string specifying the document to be loaded and compiled. An optional category for the requested document. An optional context callback for the requested document. The kind of cache data to be consumed. Cache data for accelerated compilation. True if was accepted, false otherwise. A compiled script that can be executed by multiple V8 script engine instances. To be accepted, the cache data must have been generated for identical script code by the same V8 build. Evaluates a compiled script. The compiled script to evaluate. The result value. For information about the types of result values that script code can return, see . Executes a compiled script. The compiled script to execute. This method is similar to with the exception that it does not marshal a result value to the host. It can provide a performance advantage when the result value is not needed. Cancels any pending request to interrupt script execution. This method can be called safely from any thread. Returns memory usage information for the V8 runtime. A object containing memory usage information for the V8 runtime. Begins collecting a new CPU profile. A name for the profile. True if the profile was created successfully, false otherwise. A V8 script engine can collect multiple CPU profiles simultaneously. Begins collecting a new CPU profile with the specified options. A name for the profile. Options for creating the profile. True if the profile was created successfully, false otherwise. A V8 script engine can collect multiple CPU profiles simultaneously. Completes and returns a CPU profile. The name of the profile. The profile if it was found and completed successfully, null otherwise. An empty argument selects the most recently created CPU profile. Collects a sample in all CPU profiles active in the V8 runtime. Gets or sets the time interval between automatic CPU profile samples, in microseconds. Assigning this property has no effect on CPU profiles already active in the V8 runtime. The default value is 1000. Writes a snapshot of the V8 runtime's heap to the given stream. The stream to which to write the heap snapshot. This method generates a heap snapshot in JSON format with ASCII encoding. Gets the script engine's recommended file name extension for script files. instances return "js" for this property. Allows the host to access script resources dynamically. The value of this property is an object that is bound to the script engine's root namespace. It dynamically supports properties and methods that correspond to global script objects and functions. Allows the host to access script resources. The value of this property is an object that is bound to the script engine's root namespace. It allows you to access global script resources via the class interface. Doing so is likely to perform better than dynamic access via . Executes script code as a command. The script command to execute. The command output. This method is similar to but optimized for command consoles. The specified command must be limited to a single expression or statement. Script engines can override this method to customize command execution as well as the process of converting the result to a string for console output. The version of this method attempts to use toString to convert the return value. Gets a string representation of the script call stack. The script call stack formatted as a string. This method returns an empty string if the script engine is not executing script code. The stack trace text format is defined by the script engine. Interrupts script execution and causes the script engine to throw an exception. This method can be called safely from any thread. Performs garbage collection. True to perform exhaustive garbage collection, false to favor speed over completeness. Releases the unmanaged resources used by the script engine and optionally releases the managed resources. True to release both managed and unmanaged resources; false to release only unmanaged resources. This method is called by the public method and the Finalize method. invokes the protected Dispose(Boolean) method with the parameter set to true. Finalize invokes Dispose(Boolean) with set to false. Defines options for initializing a new V8 JavaScript engine instance. Specifies that no options are selected. Specifies that script debugging features are to be enabled. Specifies that support for behavior is to be disabled. This option yields a significant performance benefit for global item access. Specifies that remote script debugging is to be enabled. This option is ignored if is not specified. Specifies that the script engine is to wait for a debugger connection and schedule a pause before executing the first line of application script code. This option is ignored if is not specified. Specifies that the script engine is to perform automatic conversion between .NET objects and JavaScript Date objects. This conversion is bidirectional and lossy. A DateTime object constructed from a JavaScript Date object always represents a Coordinated Universal Timestamp (UTC) and has its property set to . Specifies that dynamic module imports are to be enabled. This is an experimental feature and may be removed in a future release. Specifies that long integers with values greater than Number.MAX_SAFE_INTEGER or less than Number.MIN_SAFE_INTEGER are to be marshaled as BigInt. This option is ignored if is specified. Specifies that all long integers are to be marshaled as BigInt. Specifies that the script engine is to perform automatic conversion between .NET objects and JavaScript promises. This conversion is bidirectional and lossy. A Task object constructed from a JavaScript promise always has a result type of . Specifies that the script engine is to perform automatic conversion from .NET ValueTask and ValueTask<TResult> structures to JavaScript promises. This conversion is unidirectional and lossy. This option is ignored if is not specified. Defines properties that comprise ClearScript's V8 configuration. Enables or disables Top-Level Await. Top-Level Await enables code at the outermost scope of an ECMAScript 6 module to be executed as an async function. When this feature is enabled, modules can await resources, causing importers to delay evaluation as necessary. To enable Top-Level Await, set this property to true before instantiating or for the first time. Subsequent reassignment will have no effect. Gets or sets global V8 options. To override the default global options, set this property before instantiating or for the first time. Subsequent reassignment will have no effect.