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

Module Access #51

Open
justin0mcateer opened this issue Oct 30, 2020 · 4 comments
Open

Module Access #51

justin0mcateer opened this issue Oct 30, 2020 · 4 comments

Comments

@justin0mcateer
Copy link

What is the current expectation around module functionality? I don't seem to be able to utilize the in-build QuickJS modules like 'console' or 'std'. Am I doing something wrong, are these expected to be available?

If I try to load external modules, I get the following error:
_quickjs.JSException: ReferenceError: could not load module

@PetterS
Copy link
Owner

PetterS commented Oct 30, 2020

No they are not available at all.

@PetterS
Copy link
Owner

PetterS commented Oct 30, 2020

I have a couple of PRs (#21, #22) that have experimented with adding support for modules in different ways.

What you can do now is to expose Python functions to the JS code.

@justin0mcateer
Copy link
Author

I saw those PRs. Are they usable at all? One approach appears to primarily lean on additional C code from the QuickJS project. Can you comment on which approach might be the best way forward and what remains to be done to make it useful?

@PetterS
Copy link
Owner

PetterS commented Nov 5, 2020

#21 should make built-in QuickJS modules available.

But I don't really want to make them available. I am more interested in being able to parse and import JS modules.

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

No branches or pull requests

2 participants