On Friday, October 6, 2017 at 7:55:15 PM UTC+2, Colin Alworth wrote:
>
> Okay, I'm about 80% sure that I understand and can remedy the problem 
> within HtmlUnit itself. Will update once I finish syncing the apparently 
> canonical SVN repo to git, so I can go over the history more carefully and 
> ensure that this break isn't deliberate.
>

Ah, I think I understand too!
In 2.13 (before we updated), only the line number was passed to 
onerror: 
https://sourceforge.net/p/htmlunit/code/HEAD/tree/tags/HtmlUnit-2.13/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java#l1238
In 2.14, they started passing the column 
number: 
https://sourceforge.net/p/htmlunit/code/HEAD/tree/tags/HtmlUnit-2.14/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java#l1253
In 2.16, they started passing the 
exception: 
https://sourceforge.net/p/htmlunit/code/HEAD/tree/tags/HtmlUnit-2.16/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java#l1284
But note that this is the ScriptException, not a JS exception. This is 
possibly where Rhino's Context.javaToJS() is missing, as warned in the 
logs; or more accurately, the JS exception should probably be extracted out 
of the ScriptException (if (e.getCause() instanceof JavaScriptException) { 
args[4] = ((JavaScriptException) e).getValue(); }, 
see 
https://sourceforge.net/p/htmlunit/code/HEAD/tree/tags/HtmlUnit-2.19/src/main/java/com/gargoylesoftware/htmlunit/ScriptException.java#l138
 
for inspiration)
I traced that last change to https://sourceforge.net/p/htmlunit/code/9587/, 
made without a test…

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/dfac141c-c0fc-4649-bffb-a65dda025408%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to