New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrumenting .js-files with empty switch statement causes NullPointerException #179
Labels
Comments
This looks like a Rhino bug. I should be able to fix JSCover's Rhino fork. |
tntim96
added a commit
to tntim96/rhino-jscover
that referenced
this issue
Jan 14, 2015
tntim96
added a commit
that referenced
this issue
Jan 14, 2015
You can try the fix from source, the latest drone.io build <pluginRepository>
<id>Sonatype repository</id>
<name>Sonatype's Maven repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository> |
Thanks a lot! Instrumenting the file now works as expected. However, I now get |
tntim96
added a commit
to tntim96/rhino-apigee
that referenced
this issue
Jan 16, 2015
tntim96
added a commit
that referenced
this issue
Jan 18, 2015
gbrail
pushed a commit
to apigee/rhino
that referenced
this issue
Jan 21, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When instrumenting the js-files of our AngularJS website I noticed that this function causes a NullPointerException:
function(n) { switch (n.status) {} return t.reject(n) }
I use the following command
java -jar JSCover-all.jar -fs --local-storage -no-instrument=lib beautified instrumented
The stack trace looks like this
Exception in thread "main" java.lang.NullPointerException
at org.mozilla.javascript.ast.SwitchStatement.toSource(SwitchStatement.java:158)
at org.mozilla.javascript.ast.Block.toSource(Block.java:50)
at org.mozilla.javascript.ast.FunctionNode.toSource(FunctionNode.java:401)
at org.mozilla.javascript.ast.AstNode.printList(AstNode.java:454)
...
at org.mozilla.javascript.ast.AstNode.toSource(AstNode.java:300)
at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:436)
at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:411)
at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:403)
at jscover.instrument.SourceProcessor.processSourceForFileSystem(SourceProcessor.java:395)
at jscover.instrument.InstrumenterService.instrumentJSForFileSystem(InstrumenterService.java:381)
at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:404)
at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:399)
at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:390)
at jscover.filesystem.FileSystemInstrumenter.run(FileSystemInstrumenter.java:371)
at jscover.Main.runFileSystem(Main.java:479)
at jscover.Main.runJSCover(Main.java:449)
at jscover.Main.runMain(Main.java:417)
at jscover.Main.main(Main.java:406)
It would seem that the empty switch statement causes this problem.
Edit: I used your latest drone.io build.
The text was updated successfully, but these errors were encountered: