produce nashorn compatible command line script #1494

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

Comments

Projects
None yet
2 participants
@pd40

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

This comment has been minimized.

Show comment Hide comment
@valueof

valueof Jan 27, 2014

Owner

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

Owner

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 Jan 27, 2014

@valueof valueof reopened this Jan 27, 2014

@pd40

This comment has been minimized.

Show comment Hide comment
@pd40

pd40 Jan 27, 2014

This seems to work with rhino & nashorn

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

pd40 commented Jan 27, 2014

This seems to work with rhino & nashorn

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

valueof added a commit that referenced this issue Jan 27, 2014

@valueof valueof closed this Jan 27, 2014

valueof added a commit that referenced this issue Jan 27, 2014

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment