Taritsyn/MsieJavaScriptEngine

Async/Await / Promises support

ReubenBond opened this issue · 6 comments

Are there any intentions to add support for JS functions which return awaitable Promises to the caller and similarly, support for having JS code await on .NET awaitables?

If not, would it be a welcome addition?

I see that ChakraCore supports promises to some degree, with a little documentation here: https://github.com/Microsoft/ChakraCore/wiki/JavaScript-Runtime-%28JSRT%29-Overview#promises

I would welcome direction on how to best implement this :)

Hello, Reuben!

I see that ChakraCore supports promises to some degree, with a little documentation here:

Looks like, that this feature only support a ChakraCore and latest versions of Edge. MsieJavaScriptEngine
is primarily a unified interface for access to basic features of the JavaScript engines of Internet Explorer and Edge. Therefore, such a possibility is not suitable for the MsieJavaScriptEngine. By similar reasons, this functionality is not suitable for the JavaScriptEngineSwitcher.ChakraCore.

If developers need more advanced features of Chakra, then they can always use a JsRT API directly (for these purposes there is a Chakra-Samples project).

Thanks, @Taritsyn :)
I'll use the ChakraCore samples. I believe async/await support is a good feature to eventually add, and similar functionality should become present in other JS runtimes over time.

@Taritsyn do you see async support being added to JSES as more engines begin to expose support?
Would it be a welcome PR to JSES even if not all engines support it?

Would it be a welcome PR to JSES even if not all engines support it?

No. Question is closed.

@ReubenBond Try to offer your changes to developers of the jsrt-dotnet project. This project is more suitable for your feature from a technical point of view. Moreover, unlike my projects, this project gets support from Microsoft.

Thank you, @Taritsyn :) I'm using ChakraCore directly for now, async works, but I'll see if I can contribute back to jsrt-dotnet