New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The JsModuleEvaluation
method always returns a result equal to undefined
#6266
Comments
I've done a bit of digging - the ability to get a result value via JsModuleEvaluation appears to be an untested feature (nothing in the test suite looks at it) that either never worked or if it did work it was broken a while ago. As far as I can see it is not currently possible to retrieve a value from a module unless it's exported. Currently in the release branches the result from JsModuleEvaluation will always be I will have a look at fixing this. |
Hello, Richard! Thanks for quick response!
I do not know how standard this behavior is, but in the Microsoft ClearScript during evaluation of the similar code returns a numerical value.
Here I would like to receive a comment from @liminzhu. |
IIRC, as written in the ECMAScript specification, the module evaluation algorithm canonically returns a normal completion of The only thing you’re meant to be able to extract from a successfully evaluated ES module is its module namespace object (i.e. its export table). |
@fatcerberus if that's the case I should fix master to return However the documentation of JsModuleEvaluation implies that it perhaps provides some kind of useful value - which it obviously doesn't. |
I am working on implementing support of the ECMAScript 2015 static modules in a .NET library (JavaScript Engine Switcher project). I've already read the API documentation and “Steps needed for es6 modules embedding ChakraCore” discussion.
But I have not found anywhere information about how to get the result of module evaluation. Suppose there is the following code of root module:
The expected result of evaluating this module is a numerical value equal to
225
, but theJsModuleEvaluation
method always returnsundefined
.To make it easier for you to find the reason for this behavior, I created a .NET Core console application.
The text was updated successfully, but these errors were encountered: