You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the following modified docs/example/script.js through JSCover v2.0.8. It reproduces the problem.
Expected: JS is instrumented
Actual:
java.lang.IllegalStateException: FOR_OF 9 [length: 50] [source_file: /doc/example/script.js]
at com.google.common.base.Preconditions.checkState(Preconditions.java:507)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:717)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:662)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:104)
at com.google.javascript.jscomp.CodeGenerator.addFunction(CodeGenerator.java:1421)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:403)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:662)
at com.google.javascript.jscomp.CodeGenerator.add(CodeGenerator.java:104)
at com.google.javascript.jscomp.CodePrinter.toSource(CodePrinter.java:878)
at com.google.javascript.jscomp.CodePrinter.access$300(CodePrinter.java:40)
at com.google.javascript.jscomp.CodePrinter$Builder.build(CodePrinter.java:813)
at jscover.instrument.SourceProcessor.instrumentSource(SourceProcessor.java:476)
at jscover.instrument.SourceProcessor.processSourceWithoutHeader(SourceProcessor.java:435)
at jscover.instrument.SourceProcessor.processSource(SourceProcessor.java:423)
at jscover.instrument.SourceProcessor.processSourceForServer(SourceProcessor.java:411)
at jscover.instrument.InstrumenterService.instrumentJSForProxyServer(InstrumenterService.java:374)
at jscover.server.InstrumentingRequestHandler.handleGet(InstrumentingRequestHandler.java:466)
at jscover.server.HttpServer.run(HttpServer.java:416)
It looks like the for ... of statement is not fully supported.
Reproduction JS:
functiongetMessage(number){return'You selected the number '+number+'.';}functiongetMessage4(){return'You selected the number 4.';}functiongo(element){vara=[1,2,3,4];for(constrofa){console.log(r);}varm=[[1,2],[3,4]];for(const[x,y]ofm){console.log(x);console.log(y);}varmessage;if(element.id==='radio1'){message='You selected the number 1.';}elseif(element.id==='radio2'){message=getMessage(2);}elseif(element.id==='radio3'){message=getMessage(3);}elseif(element.id==='radio4'){message=getMessage4();}vardiv=document.getElementById('request');div.className='black';div=document.getElementById('result');div.innerHTML='<p>'+message+'</p>';div.innerHTML+='<p>If you are running the instrumented version of this program, you can click the "Summary" tab to view a coverage report.</p>';}
The text was updated successfully, but these errors were encountered:
Run the following modified docs/example/script.js through JSCover v2.0.8. It reproduces the problem.
Expected: JS is instrumented
Actual:
It looks like the for ... of statement is not fully supported.
Reproduction JS:
The text was updated successfully, but these errors were encountered: