-
Notifications
You must be signed in to change notification settings - Fork 31
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
Question about the content of module and module.children #27
Comments
I've done a little test to explain well what I mean. I've created 4 modules (written in typescript and transpiled with module set to commonjs). The relation between modules is as follow:
The test:
The test has been run both with the original code of nashorn-commonjs-modules and with the The attached zip contains the java main to run the test, the four js modules, the two json produced from the runs. |
I've found the moment when the change has been made: |
Sorry, I haven't been much responsive, as mentioned in another issue I'm deep into house renovation work 😁 From what I remember, I added this part to copy the content of the global scope, because I'll put those changes in a PR and do some more testing. |
Don't worry @malaporte and thanks for your response. I'd like to contribute. I've read this (Nashornjsr223 enginenotes --global-per-engineoption) and some other posts on the mailing list of Nashorn. I've examined the diff between the current and the previous version of The reference to |
I have the following script:
I pass the script to the engine (
eval
) and then I map each instance to a java class with the method getInterface(object, class).The two modules and the two instances are created in the
engineScope
.In the
Module.class
there is this part:and then this other part:
So at the end I have module1 and instance1 among the children of module2. Obviously I have also all other things present in the engineScope (e.g. require, exports, and module
<main>
). The more I load module the more the structure becomes redundant.Considering that I am new to Nashorn and node.js and there is no many information about module.children I'm questioning if it is correct to put the full content of the engineScope as child of a module.
Thanks for your attention.
aris
P.S. I've tried to comment
module.putAll(engineScope)
: it works even so and the content of children seems more correct to me because I see only the module objects required by the one I'm inspecting.The text was updated successfully, but these errors were encountered: