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

org.mozilla.javascript.EvaluatorException #36

Closed
lpaulger opened this Issue Jan 3, 2013 · 5 comments

Comments

Projects
None yet
2 participants
@lpaulger

lpaulger commented Jan 3, 2013

For about 2/3 of my js files I am seeing this error when running

java -jar target/dist/JSCover-all.jar -fs --branch scripts/app jscover

this is a file that causes the issue

Exception in thread "main" org.mozilla.javascript.EvaluatorException: illegal character (ogs.checkout.Factory.js#1)

(function() {

 function CheckoutFactory(api) {
   var self = this;

   self.createCheckout = function(model) {

     var checkout = new window.checkout.CheckoutViewModel(model, api);

      return checkout;
   };
}

window.checkout.Factory = CheckoutFactory;
}());

but some larger more complex files seem to run ok. I'm not sure what's going on. Should I avoid using the -fs option?

@tntim96

This comment has been minimized.

Show comment
Hide comment
@tntim96

tntim96 Jan 3, 2013

Owner

Should I avoid using the -fs option?

No, this indicates that Rhino is unable to read the script. Also, when I tried the code snippet above it worked fine.

What version of JSCover are you using?

Owner

tntim96 commented Jan 3, 2013

Should I avoid using the -fs option?

No, this indicates that Rhino is unable to read the script. Also, when I tried the code snippet above it worked fine.

What version of JSCover are you using?

@ghost ghost assigned tntim96 Jan 3, 2013

@lpaulger

This comment has been minimized.

Show comment
Hide comment
@lpaulger

lpaulger Jan 4, 2013

I'm using v0.2.0 of JSCover. Additionally here is the stack trace if it helps:

 Exception in thread "main" org.mozilla.javascript.EvaluatorException: illegal character  (src/Content/scripts/app/ogs.checkout.Factory.js#1)
    at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77)
    at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:64)
    at org.mozilla.javascript.Parser.addError(Parser.java:188)
    at org.mozilla.javascript.Parser.addError(Parser.java:166)
    at org.mozilla.javascript.Parser.addError(Parser.java:162)
    at org.mozilla.javascript.TokenStream.getToken(TokenStream.java:832)
    at org.mozilla.javascript.Parser.peekToken(Parser.java:296)
    at org.mozilla.javascript.Parser.name(Parser.java:2880)
    at org.mozilla.javascript.Parser.primaryExpr(Parser.java:2792)
    at org.mozilla.javascript.Parser.memberExpr(Parser.java:2418)
    at org.mozilla.javascript.Parser.unaryExpr(Parser.java:2316)
    at org.mozilla.javascript.Parser.mulExpr(Parser.java:2241)
    at org.mozilla.javascript.Parser.addExpr(Parser.java:2225)
    at org.mozilla.javascript.Parser.shiftExpr(Parser.java:2206)
    at org.mozilla.javascript.Parser.relExpr(Parser.java:2181)
    at org.mozilla.javascript.Parser.eqExpr(Parser.java:2153)
    at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:2142)
    at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:2131)
    at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:2120)
    at org.mozilla.javascript.Parser.andExpr(Parser.java:2109)
    at org.mozilla.javascript.Parser.orExpr(Parser.java:2098)
    at org.mozilla.javascript.Parser.condExpr(Parser.java:2062)
    at org.mozilla.javascript.Parser.assignExpr(Parser.java:2033)
    at org.mozilla.javascript.Parser.expr(Parser.java:2012)
    at org.mozilla.javascript.Parser.nameOrLabel(Parser.java:1765)
    at org.mozilla.javascript.Parser.statementHelper(Parser.java:1032)
    at org.mozilla.javascript.Parser.statement(Parser.java:901)
    at org.mozilla.javascript.Parser.parse(Parser.java:540)
    at org.mozilla.javascript.Parser.parse(Parser.java:478)
    at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:408)
    at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:394)
    at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:386)
    at jscover.instrument.SourceProcessor.processSourceForFileSystem(SourceProcessor.java:379)
    at jscover.instrument.InstrumenterService.instrumentJSForFileSystem(InstrumenterService.java:374)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:399)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:385)
    at jscover.filesystem.FileSystemInstrumenter.run(FileSystemInstrumenter.java:366)
    at jscover.Main.runFileSystem(Main.java:455)
    at jscover.Main.runMain(Main.java:422)
    at jscover.Main.main(Main.java:411)

lpaulger commented Jan 4, 2013

I'm using v0.2.0 of JSCover. Additionally here is the stack trace if it helps:

 Exception in thread "main" org.mozilla.javascript.EvaluatorException: illegal character  (src/Content/scripts/app/ogs.checkout.Factory.js#1)
    at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77)
    at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:64)
    at org.mozilla.javascript.Parser.addError(Parser.java:188)
    at org.mozilla.javascript.Parser.addError(Parser.java:166)
    at org.mozilla.javascript.Parser.addError(Parser.java:162)
    at org.mozilla.javascript.TokenStream.getToken(TokenStream.java:832)
    at org.mozilla.javascript.Parser.peekToken(Parser.java:296)
    at org.mozilla.javascript.Parser.name(Parser.java:2880)
    at org.mozilla.javascript.Parser.primaryExpr(Parser.java:2792)
    at org.mozilla.javascript.Parser.memberExpr(Parser.java:2418)
    at org.mozilla.javascript.Parser.unaryExpr(Parser.java:2316)
    at org.mozilla.javascript.Parser.mulExpr(Parser.java:2241)
    at org.mozilla.javascript.Parser.addExpr(Parser.java:2225)
    at org.mozilla.javascript.Parser.shiftExpr(Parser.java:2206)
    at org.mozilla.javascript.Parser.relExpr(Parser.java:2181)
    at org.mozilla.javascript.Parser.eqExpr(Parser.java:2153)
    at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:2142)
    at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:2131)
    at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:2120)
    at org.mozilla.javascript.Parser.andExpr(Parser.java:2109)
    at org.mozilla.javascript.Parser.orExpr(Parser.java:2098)
    at org.mozilla.javascript.Parser.condExpr(Parser.java:2062)
    at org.mozilla.javascript.Parser.assignExpr(Parser.java:2033)
    at org.mozilla.javascript.Parser.expr(Parser.java:2012)
    at org.mozilla.javascript.Parser.nameOrLabel(Parser.java:1765)
    at org.mozilla.javascript.Parser.statementHelper(Parser.java:1032)
    at org.mozilla.javascript.Parser.statement(Parser.java:901)
    at org.mozilla.javascript.Parser.parse(Parser.java:540)
    at org.mozilla.javascript.Parser.parse(Parser.java:478)
    at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:408)
    at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:394)
    at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:386)
    at jscover.instrument.SourceProcessor.processSourceForFileSystem(SourceProcessor.java:379)
    at jscover.instrument.InstrumenterService.instrumentJSForFileSystem(InstrumenterService.java:374)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:399)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:394)
    at jscover.filesystem.FileSystemInstrumenter.copyFolder(FileSystemInstrumenter.java:385)
    at jscover.filesystem.FileSystemInstrumenter.run(FileSystemInstrumenter.java:366)
    at jscover.Main.runFileSystem(Main.java:455)
    at jscover.Main.runMain(Main.java:422)
    at jscover.Main.main(Main.java:411)
@tntim96

This comment has been minimized.

Show comment
Hide comment
@tntim96

tntim96 Jan 5, 2013

Owner

If it works for me, the next thing to check is the encoding.

Owner

tntim96 commented Jan 5, 2013

If it works for me, the next thing to check is the encoding.

@lpaulger

This comment has been minimized.

Show comment
Hide comment
@lpaulger

lpaulger Jan 7, 2013

Encoding seemed to fix my issue. I used

 -Dfile.encoding=UTF-8

and everything ran fine in both server and filesystem mode. What is the default encoding option?

Thanks again for the assistance!

lpaulger commented Jan 7, 2013

Encoding seemed to fix my issue. I used

 -Dfile.encoding=UTF-8

and everything ran fine in both server and filesystem mode. What is the default encoding option?

Thanks again for the assistance!

@lpaulger lpaulger closed this Jan 7, 2013

@tntim96

This comment has been minimized.

Show comment
Hide comment
@tntim96

tntim96 Jan 8, 2013

Owner

What is the default encoding option

It's all in the manual, but in short it defaults to your platform's default encoding. To see what that is (as well as all options), run java -jar JSCover-all.jar -h encoding

Owner

tntim96 commented Jan 8, 2013

What is the default encoding option

It's all in the manual, but in short it defaults to your platform's default encoding. To see what that is (as well as all options), run java -jar JSCover-all.jar -h encoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment