On Tuesday, July 17, 2012 2:53:13 AM UTC+2, Paul Stockley wrote:
I can tell you that if you are working in anyway with JSO objects, devmode will mask out null pointer exceptions. Maybe this is related. The problem has to do with the JS method devmode uses to execute the JSNI code in the browser. The stupid JS spec says if an object is null just do nothing, When executing the JS for real this method isn't used and you get an error.
It's not "just do nothing", it's "use the global object" (or maybe "look up the scope chain").
To make things clear for everyone: DevMode executes JSNI method's by using .call() on the JS Function, passing the 'this' object (jsniFunc.call(thisObj, args)), and that object can be 'null', executing the method with the global object (equivalent to 'window') as the 'this' object. In prod mode though, the code is compiled to a real method call (thisObj.jsniFunc(arg1, arg2), or "staticified" as jsniFunc(thisObj, arg1, arg2)) and then there can be a "null has no jsniFunc property" error at runtime.