tntim96 / JSCover

JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage
GNU General Public License v2.0
399 stars 84 forks source link

Exception in thread #261

Closed MaxYang1991 closed 7 years ago

MaxYang1991 commented 7 years ago

instrument web application in --local-storage file mode,throw "Exception in thread" when i execute jscover-filesystem.sh. Below is the response stacktrace


Exception in thread "pool-2-thread-220" java.lang.IllegalStateException
    at com.google.common.base.Preconditions.checkState(Preconditions.java:429)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:583)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:106)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:992)
    at com.google.javascript.jscomp.CodeGenerator.addExpr(CodeGenerator.java:1561)
    at com.google.javascript.jscomp.CodeGenerator.addStringKey(CodeGenerator.java:1636)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:960)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:106)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:992)
    at com.google.javascript.jscomp.CodeGenerator.addExpr(CodeGenerator.java:1561)
    at com.google.javascript.jscomp.CodeGenerator.addList(CodeGenerator.java:1605)
    at com.google.javascript.jscomp.CodeGenerator.addList(CodeGenerator.java:1593)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:821)
    at com.google.javascript.jscomp.CodeGenerator.addExpr(CodeGenerator.java:1561)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:149)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:934)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:638)
    at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:106)
    at com.google.javascript.jscomp.CodePrinter.toSource(CodePrinter.java:875)
    at com.google.javascript.jscomp.CodePrinter.access$300(CodePrinter.java:42)
    at com.google.javascript.jscomp.CodePrinter$Builder.build(CodePrinter.java:821)
    at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:475)
    at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:435)
    at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:423)
    at jscover.instrument.SourceProcessor.processSourceForFileSystem(SourceProcessor.java:415)
    at jscover.instrument.InstrumenterService.instrumentJSForFileSystem(InstrumenterService.java:381)
    at jscover.filesystem.FileSystemInstrumenter$3.run(FileSystemInstrumenter.java:425)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

I look forward to your early reply

tntim96 commented 7 years ago

Can you provide the JavaScript snippet that causes this?

MaxYang1991 commented 7 years ago

just one js file,throw exception,and create fail in taget file test.zip

tntim96 commented 7 years ago

Thanks for the report - looking into it now.

tntim96 commented 7 years ago

This doesn't look like valid JavaScript:

    mounted () {
        this.onReady();
    },
MaxYang1991 commented 7 years ago

this is vue.js component, writen with JavaScript es6 ,

tntim96 commented 7 years ago

Yep. Think that's fixed now. Can you build from source to test or use the latest 2.0.2-SNAPSHOT?

MaxYang1991 commented 7 years ago

Thanks a lot,but sorry for that i do not konw how to build from source to test =. =

tntim96 commented 7 years ago

I've uploaded to http://jscover.sourceforge.net/latest/JSCover-all.jar. Let me know how that goes.

tntim96 commented 7 years ago

I've released a fix. Let me know if there are any problems.

MaxYang1991 commented 7 years ago

Next monday i'll test it,thanks,have a good weekend

MaxYang1991 commented 7 years ago

Test OK ,Thanks