Permalink
Browse files

Removing env js, that was a bit overkill. Stubbing console instead

  • Loading branch information...
1 parent 0d80551 commit 7f43d13911c6f83357fc78fcffb772ef4482bcfb @philmander committed Mar 31, 2013
@@ -33,8 +33,6 @@
private static final String JSHINT_RUNNER_LOC = "/com/philmander/jshint/jshint-runner.js";
- private static final String ENVJS_LOC = "/com/philmander/jshint/env.js";
-
private JsHintLogger logger = null;
private String jshintSrc = null;
@@ -147,16 +145,11 @@ public JsHintReport lint(String[] files, Properties options, Properties undefs)
// start rhino
Context ctx = Context.enter();
ctx.setLanguageVersion(Context.VERSION_1_7);
- ctx.setOptimizationLevel(-1);
ScriptableObject global = ctx.initStandardObjects();
String[] names = { "print" };
global.defineFunctionProperties(names, JsHintRunner.class, ScriptableObject.DONTENUM);
- //load env js
- InputStream runEnvIn = this.getClass().getResourceAsStream(ENVJS_LOC);
- JSSourceFile runEnv = JSSourceFile.fromInputStream(ENVJS_LOC, runEnvIn);
-
// get js hint source from classpath or user file
InputStream jsHintIn = jshintSrc != null ? new FileInputStream(new File(jshintSrc)) : this.getClass()
.getResourceAsStream(JSHINT_LOC);
@@ -167,7 +160,7 @@ public JsHintReport lint(String[] files, Properties options, Properties undefs)
JSSourceFile runJsHint = JSSourceFile.fromInputStream(JSHINT_RUNNER_LOC, runJsHintIn);
// load jshint
- ctx.evaluateReader(global, runEnv.getCodeReader(), runEnv.getName(), 0, null);
+ //ctx.evaluateReader(global, runEnv.getCodeReader(), runEnv.getName(), 0, null);
ctx.evaluateReader(global, jsHintSrc.getCodeReader(), jsHintSrc.getName(), 0, null);
// define properties to store current js source info
Oops, something went wrong.

0 comments on commit 7f43d13

Please sign in to comment.