Permalink
Browse files

Issue #1494: Add support for the Nashorn JavaScript engine

  • Loading branch information...
1 parent fde6c19 commit 1c6568eb52eb73dcb8f3b7d063c562d709fef027 @valueof valueof committed Jan 27, 2014
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/platforms/rhino.js
@@ -5,12 +5,14 @@
"use strict";
var filenames = [];
- var flags = {};
+ var flags = {};
+ var opts = {};
+ var globals = {};
+ var retval = 0;
+ var readf = (typeof readFully === "function" ? readFully : readFile);
+
var optstr; // arg1=val1,arg2=val2,...
var predef; // global1=true,global2,global3,...
- var opts = {};
- var globals = {};
- var retval = 0;
args.forEach(function (arg) {
if (arg.indexOf("--") === 0) {
@@ -52,7 +54,7 @@
if ("config" in flags) {
var cfgFileContent;
try {
- cfgFileContent = readFile(flags.config);
+ cfgFileContent = readf(flags.config);
} catch (e) {
print("Could not read config file " + flags.config);
quit(1);
@@ -92,7 +94,7 @@
}
filenames.forEach(function (name) {
- var input = readFile(name);
+ var input = readf(name);
if (!input) {
print("jshint: Couldn't open file " + name);

0 comments on commit 1c6568e

Please sign in to comment.