ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript.JavaScript
JavaScriptExtensions Class
JavaScriptExtensions Methods

# JavaScriptExtensions Class

Defines extension methods for use with JavaScript engines.
Inheritance Hierarchy
SystemObject
Microsoft.ClearScript.JavaScriptJavaScriptExtensions
Namespace: Microsoft.ClearScript.JavaScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public static class JavaScriptExtensions

    <ExtensionAttribute>
    Public NotInheritable Class JavaScriptExtensions

    [ExtensionAttribute]
    public ref class JavaScriptExtensions abstract sealed

    [<AbstractClassAttribute>]
    [<SealedAttribute>]
    [<ExtensionAttribute>]
    type JavaScriptExtensions = class end

The JavaScriptExtensions type exposes the following members.

Methods

| Name | Description
--- | --- | ---
| ToAsyncEnumerable | Supports managed asynchronous iteration over an async-iterable script object.
| ToEnumerable | Supports managed iteration over an iterable script object.
| ToPromise(Task) | Converts a Task instance to a promise for use with script code currently running on the calling thread.
| ToPromise(ValueTask) | Converts a ValueTask instance to a promise for use with script code currently running on the calling thread.
| ToPromise(Task, ScriptEngine) | Converts a Task instance to a promise for use with script code running in the specified script engine.
| ToPromise(ValueTask, ScriptEngine) | Converts a ValueTask instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(TaskT) | Converts a TaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(ValueTaskT) | Converts a ValueTaskTResult instance to a promise for use with script code currently running on the calling thread.
| ToPromiseT(TaskT, ScriptEngine) | Converts a TaskTResult instance to a promise for use with script code running in the specified script engine.
| ToPromiseT(ValueTaskT, ScriptEngine) | Converts a ValueTaskTResult instance to a promise for use with script code running in the specified script engine.
| ToTask | Converts a promise to a Task<Object> instance.

Top
See Also

#### Reference

Microsoft.ClearScript.JavaScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft