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

Add support for Rhino/Nashorn #316

Open
chochos opened this issue Jan 24, 2014 · 5 comments
Open

Add support for Rhino/Nashorn #316

chochos opened this issue Jan 24, 2014 · 5 comments
Labels
Milestone

Comments

@chochos
Copy link
Member

chochos commented Jan 24, 2014

To be able to run on Rhino and/or Nashorn, the native code needs some changes:

  • process, runtime and system need to be aware of these VM's (find out somehow that the VM being used is Rhino/Nashorn, not node or browser)
  • print and the write/writeLine/etc methods need to use Rhino's print function (and also support whatever Nashorn uses)
@chochos
Copy link
Member Author

chochos commented Mar 20, 2014

So Nashorn doesn't include any facility to load CommonJS modules. I tried using this one https://github.com/micmath/Rhino-Require but it seems nashorn can't load large modules; it throws an exception trying to load the language module.

@chochos
Copy link
Member Author

chochos commented May 7, 2014

Nashorn can't parse the language module model (a JSON object in one 356KB-long line). Rhino didn't have a problem with this.

@quintesse
Copy link
Member

You say "line", is it able to read the language module of it's separated into several shorter lines? Other ways of splitting it up perhaps?

@chochos
Copy link
Member Author

chochos commented May 10, 2014

Yeah if you split it into several lines then it works.

But then reading it in the compiler and runner becomes more complicated. And splitting it also becomes complicated. All just so that nashorn's shitty parser can read it. Rhino didn't have this problem, and neither does node or any browser we've tested.

@tombentley
Copy link
Member

I'm guessing you didn't test IE6 then ;-)

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

No branches or pull requests

3 participants