Hello,
HtmlUnit failed to parse a Javascript (maybe the javascript is malformed) with the error :
ERROR [main] (com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter) - error: message=[missing ; before statement] sourceName=...
Browsers are able to manage that missing ; so is there any parameter at the htmlUnit that would allow me set the parsing to a less strict mode ?
Regards,
Christophe
Please provide test case.
Hi,
Here is the javascript file that failed to be parsed : https://goo.gl/iQCpw3
Regards,
Christophe
Ok, can reproduce your problem, but the js file hast 17000 lines, and contains also minified js code. If you like to have this fixed it will be a great help if you can strip down this to a simple sample.
From a first look i guess class definitions like
are not supported by Rhino/Core-JS so far
Hi,
Thank you for your help. Unfortunately this is a JS from one of our customer and we have no option to alter it.
Is there any option to skip the unsupported code ?
Regards,
Christophe
Maybe you can try to 'fix' the code by makeing some changes before HtmlUnit tries to parse the code.
Have a look at the FAQ. There is a sample
How to modify the outgoing request or incomming response.
Last edit: RBRi 2017-08-30
Hi,
I did it and it works now. Any idea when HtmlUnit will be able to manage classes in Javascript ?
Regards,
Christophe
This depends on Rhino, maybe you can ask there or vote...