Thursday, October 2, 2014

ie10 permutation causing browser errors? (gwt 2.6.1) really baffled here.

If I want my GWT2.6.1 application to compile to ie10, this is correct isn't it;

<set-property name="user.agent" value="ie8,ie9,opera,gecko1_8,safari,ie10" />

?

Because my app is producing this bizarre error in ie10;

SEVERE: Exception caught: (TypeError) 
 description: Object doesn't support property or method 'replace'
 number: -2146827850
 stack: TypeError: Object doesn't support property or method 'replace'
   at $trim (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:45877:3)
   at $getZindex (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:8859:3)
   at $onLoad (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:8974:5)
   at $onLoad_0 (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:10025:3)
   at onLoad_2 (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:10453:3)
   at $onAttach (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:3021:3)
   at onAttach (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:3126:3)
   at execute_24 (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:41620:3)
   at tryCommand (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:41595:7)
   at doAttachChildren_0 (http://www.lostagain.nl/games/%5BThorn%5D%20Game/code/2A19E36B832C073830A38A4BA25AD56D.cache.html:4040:3)
 __gwt$exception: <skipped>: Object doesn't support property or method 'replace'com.google.gwt.user.client.ui.AttachDetachException: Exception caught: (TypeError) 
 description: Object doesn't support property or method 'replace'

Note the "trim()" - which I was astonished to learn recently wasn't supported on ie8.

Is this just a coincidence and the error lies elsewhere? or is somehow a ie8 permutation running in ie10?
Can anything else override what permutation is picked to run?

The application works fine on chrome, firefox and opera.

The problem is a bit more curious, however, as some trim statements do work.
Heres the code triggering the crash:

 SOLog.info("~~~~~Just before trimming");
 SOLog.info(""+GWT.getHostPageBaseURL().trim()); //displays the homepage url fine
       
 Element ParentElement = this.getElement().getParentElement();
 SOLog.info("Got parent E"); //displays
 Style ElementStyle = ParentElement.getStyle();
 SOLog.info("Got parent Style"); //displays
 String ZindexNonTrim = ElementStyle.getZIndex();
 SOLog.info("Got parent Zindex "+ZindexNonTrim); //reachs here fine. The zindex of the element happens to be 30 and that value displays in the log correctly
       
 SOLog.info(""+ZindexNonTrim.getClass().getName()); //this results in "java.lang.string"
       
 String blar = "30".trim();   //this trim works      
 SOLog.info("Well gosh darnit! "+blar);

 String zindexstring = ZindexNonTrim.trim(); //this one causes the crash <<<<<<<<<<<<<<
 SOLog.info("~~~~~zomg no crashyness?");



I just cant get my head around why a string.trim() is causing a crash when other string.trims() are not.


HELP!

;(

Appreciate anything,
Thomas Wrobel


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment