Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

jslint4java issue with JSLINT.report functions section #135

Closed
wants to merge 1 commit into from

2 participants

@hthetiot

Hello,

I'm currently use JSLint with jslint4java, in order to use your last version i use the option "jslint" that allow me to use your github master instead of the jslint version "2012-02-03" that is included into jslint4java.

I got a problem and i think it could be nice to merge this simple fix for future jslint4java upgrade.

java -jar jslint4java-2.0.2.jar --jslint JSLint/jslint.js src/Core.js 
Exception in thread "main" org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined (../../vendors/JSLint/jslint.js#6364)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3785)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3763)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3791)
    at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3810)
    at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3823)
    at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1508)
    at org.mozilla.javascript.gen.______vendors_JSLint_jslint_js_1._c_anonymous_184(../../vendors/JSLint/jslint.js:6364)
    at org.mozilla.javascript.gen.______vendors_JSLint_jslint_js_1.call(../../vendors/JSLint/jslint.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
    at org.mozilla.javascript.gen.______vendors_JSLint_jslint_js_1.call(../../vendors/JSLint/jslint.js)
    at com.googlecode.jslint4java.JSLint$2.run(JSLint.java:208)
    at org.mozilla.javascript.Context.call(Context.java:521)
    at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
    at com.googlecode.jslint4java.JSLint.callReport(JSLint.java:198)
    at com.googlecode.jslint4java.JSLint.access$200(JSLint.java:31)
    at com.googlecode.jslint4java.JSLint$1.run(JSLint.java:167)
    at org.mozilla.javascript.Context.call(Context.java:521)
    at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
    at com.googlecode.jslint4java.JSLint.buildResults(JSLint.java:158)
    at com.googlecode.jslint4java.JSLint.lint(JSLint.java:282)
    at com.googlecode.jslint4java.JSLint.lint(JSLint.java:265)
    at com.googlecode.jslint4java.cli.Main.lintFile(Main.java:158)
    at com.googlecode.jslint4java.cli.Main.run(Main.java:112)
    at com.googlecode.jslint4java.cli.Main.main(Main.java:96)

Thx by advance, what ever you decide ;)

@douglascrockford

Thanks.

@hthetiot

No thanks to you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2012
  1. @hthetiot

    Fix jslint4java error

    hthetiot authored
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 21 deletions.
  1. +23 −21 jslint.js
View
44 jslint.js
@@ -6361,27 +6361,29 @@ klass: do {
output[0] = '';
}
- for (i = 0; i < data.functions.length; i += 1) {
- the_function = data.functions[i];
- names = [];
- if (the_function.params) {
- for (j = 0; j < the_function.params.length; j += 1) {
- names[j] = the_function.params[j].string;
- }
- }
- output.push('<dl><address>line ' +
- String(the_function.line) + '</address>' +
- the_function.name.entityify() +
- '(' + names.join(', ') + ')');
- detail('undefined', the_function['undefined']);
- detail('unused', the_function.unused);
- detail('closure', the_function.closure);
- detail('variable', the_function['var']);
- detail('exception', the_function.exception);
- detail('outer', the_function.outer);
- detail('global', the_function.global);
- detail('label', the_function.label);
- output.push('</dl>');
+ if (data.functions) {
+ for (i = 0; i < data.functions.length; i += 1) {
+ the_function = data.functions[i];
+ names = [];
+ if (the_function.params) {
+ for (j = 0; j < the_function.params.length; j += 1) {
+ names[j] = the_function.params[j].string;
+ }
+ }
+ output.push('<dl><address>line ' +
+ String(the_function.line) + '</address>' +
+ the_function.name.entityify() +
+ '(' + names.join(', ') + ')');
+ detail('undefined', the_function['undefined']);
+ detail('unused', the_function.unused);
+ detail('closure', the_function.closure);
+ detail('variable', the_function['var']);
+ detail('exception', the_function.exception);
+ detail('outer', the_function.outer);
+ detail('global', the_function.global);
+ detail('label', the_function.label);
+ output.push('</dl>');
+ }
}
return output.join('');
};
Something went wrong with that request. Please try again.