Skip to content
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

[Clarify request] Question about support module loading in host #4472

Closed
JohnMasen opened this issue Dec 22, 2017 · 2 comments
Closed

[Clarify request] Question about support module loading in host #4472

JohnMasen opened this issue Dec 22, 2017 · 2 comments

Comments

@JohnMasen
Copy link

hi,
I'm working on a library which porting the chakracore to dotnetcore (Chakracore.NET on Github).
After reading the PR (#1254), I have a question about the host implementation:

What does "1. Load top level script " mean? I'm using JsRunScript to execute the script. does the "Load" means "serialize the script"? I tried to read the C++ source., but due to lack of C++ experience, still can't confirm my assumption.
It would be good to provide a JSRTApi call steps of how to implement the module supported hosting.
Thanks

@obastemur
Copy link
Collaborator

I'm using JsRunScript to execute the script.

Don't. At least, not for module script source.

See https://github.com/Microsoft/ChakraCore/blob/c6026b45bb187cddf373d14abf7c2f63c9aae525/bin/ch/WScriptJsrt.cpp#L355

Important JSRT calls;

  • JsInitializeModuleRecord
  • JsSetModuleHostInfo
  • JsParseModuleSource

@JohnMasen
Copy link
Author

OK, I got it. seems support module requires different API to execute the script.
Thanks obastemur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants