Open GoogleCodeExporter opened 8 years ago
Can you supply a small piece of Javascript, and a fragment of your ant build
file that replicates this?
Thanks!
Original comment by d...@happygiraffe.net
on 21 May 2013 at 10:24
Sure. However the issue happens everytime no matter what's the file content,
see the top of the Exception stacktrace. What's interesting, if I run it from
the command line, program works fine. It seems to be connected only to ant task
use.
fragments from the config:
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask"
classpath="${libdir.shared}/jslint/jslint4java-2.0.5.jar"/>
<target name="jslinter">
<jslint>
<formatter type="plain" destfile="plain-report.txt"/>
<fileset dir="${app.src}" includes="**/*.js"/>
</jslint>
</target>
test.js:
function max(x, y) {
return x > y ? x : y;
}
Original comment by ales.najmann
on 21 May 2013 at 12:17
Using that build and that src file, I get one error:
% cat build.xml
<project>
<taskdef name="jslint"
classname="com.googlecode.jslint4java.ant.JSLintTask"
classpath="/opt/misc/jslint4java/jslint4java-2.0.5.jar" />
<target name="jslinter">
<jslint>
<formatter type="plain" destfile="plain-report.txt"/>
<fileset dir="." includes="**/*.js"/>
</jslint>
</target>
</project>
% cat max.js
function max(x, y) {
return x > y ? x : y;
}
% ant jslinter
Buildfile: /tmp/jslint4java-issue-98/build.xml
jslinter:
BUILD FAILED
/tmp/jslint4java-issue-98/build.xml:6: JSLint: 1 error in 1 file
Total time: 0 seconds
% cat plain-report.txt
/tmp/jslint4java-issue-98/max.js:2:5: Missing 'use strict' statement.
return x > y ? x : y;
^
Can I ask what version of Java (and what OS) you're using? I haven't seen
this, despite having a test suite that should pick up such things.
Original comment by d...@happygiraffe.net
on 21 May 2013 at 4:18
OS platform:
Windows XP SP3
Java version:
java version "1.7.0_15"
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)
Ant version:
Apache Ant(TM) version 1.8.4 compiled on May 22 2012
~
I also don't believe much in the bug in the distributed package. I just don't
know what to do with all this. In the stacktrace you can see the the rhino
being unable to process jslint.js file distributed with the jar. Is the
classpath wrong or something? I really have no idea.
Original comment by ales.najmann
on 22 May 2013 at 3:23
I had the exact same problem when running in Eclipse. The error was that
yuicompressor-2.4.8 was in my classpath and it contains a non compatible
version of Rhino.
So the above problem is most probably also a classpath problem not related to
jslint4java.
Original comment by mathias....@netset.se
on 3 Sep 2013 at 9:47
I had the same problem and could fix it by including rhino 1.7R4 instead of
rhino 1.7R2
Original comment by mathias....@gmail.com
on 30 Oct 2013 at 1:51
Original issue reported on code.google.com by
ales.najmann
on 21 May 2013 at 8:40