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

Fix: include returns undefined for classes #1075

Closed
plata opened this issue Jul 27, 2019 · 6 comments
Closed

Fix: include returns undefined for classes #1075

plata opened this issue Jul 27, 2019 · 6 comments

Comments

@plata
Copy link
Collaborator

plata commented Jul 27, 2019

For

class test { myMethod() {}}

it gives "undefined".
For

class test { myMethod() {}}
test

it gives "class test { myMethod() {}}".

This is caused by a bugfix in graaljs.

Affected:

  • Verbs
  • Plugins
  • Settings

Possible solutions:

  • (class C {})
  • class C {}; C
  • use old graaljs version (19.0.0)

see PhoenicisOrg/phoenicis#2040

@madoar
Copy link
Collaborator

madoar commented Jul 28, 2019

I'm in favor of the third solution:

use old graaljs version (19.0.0)

because it is the quickest solution, leads to no problems for us as far as I know, and is also the easiest solution to reverse when we found a solution for PhoenicisOrg/phoenicis#2042

@plata
Copy link
Collaborator Author

plata commented Jul 28, 2019

I would vote for one of the other solutions because

  • it allows us to update graaljs
  • I have the feeling that we will not be able to use ES modules or node modules

@madoar
Copy link
Collaborator

madoar commented Jul 28, 2019

What about extending our own include mechanism to provide explicit exports?
We could even try to execute included scripts in an isolated environment (i.e. their own polyglot context) and inject the populated result object in the calling script.

@plata
Copy link
Collaborator Author

plata commented Jul 28, 2019

What do we gain with explicit exports?
I don't think an isolated environment would work e.g. for engine plugins.

@madoar
Copy link
Collaborator

madoar commented Jul 28, 2019

Explicit exports make the code easier to understand. In addition we are able to export multiple things in one script.

About executing the included scripts in an isolated environment:
It seems like this is blocked by oracle/graal#631

@madoar
Copy link
Collaborator

madoar commented Aug 11, 2019

@plata I think this is fixed by #1076. Can we close this?

@plata plata closed this as completed Aug 12, 2019
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