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

produce nashorn compatible command line script #1494

Closed
pd40 opened this issue Jan 26, 2014 · 2 comments
Closed

produce nashorn compatible command line script #1494

pd40 opened this issue Jan 26, 2014 · 2 comments

Comments

@pd40
Copy link

pd40 commented Jan 26, 2014

OpenJDK 8.0 will include the new nashorn javascript engine instead of rhino.

jshint 2.4.3 rhino.js script appears to work with nashorn with one minor modification. Changing the rhino shell readFile() function call to nashorn compatible readFully()

filenames.forEach(function (name) {
    var input = readFully(name);

    if (!input) {
      print("jshint: Couldn't open file " + name);
      quit(1);
    }

The nashorn script engine does not suffer from #1422

@valueof
Copy link
Member

valueof commented Jan 27, 2014

Will there still be readFile? Will the var input = (typeof readFully == "function" ? readFully : readFile)(name); approach work?

@valueof valueof closed this as completed Jan 27, 2014
@valueof valueof reopened this Jan 27, 2014
@pd40
Copy link
Author

pd40 commented Jan 27, 2014

This seems to work with rhino & nashorn

var readFileFully = (typeof readFully === "function" ? readFully : readFile);

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