From: Lukas J. <luk...@de...> - 2011-05-09 08:18:07
|
Thank you for your answer. I was pretty sure that I had looked trough all the code I use to do the fix that you propuse. For example in my own copy of GWT-OL I have already changed JArrayBaseImpl so it looks like: protected static native JSObject create(int length) /*-{ if (length < 0) { return new $wnd.Array(); } else { return new $wnd.Array(length); } }-*/; But my error is still present. /Lukas Från: Alexander Solovets [mailto:aso...@gm...] Skickat: den 9 maj 2011 09:57 Till: Lukas Johansson Kopia: gwt...@li... Ämne: Re: [Gwt-openlayers-users] Firefox4 - Problems with arrays Hi, Lukas! A brief look into JArrayString and related sources says the reason of your error is inappropriate native 'Array' creation. Using any global JS objects one should use $wnd as the scope object. And JArrayBaseImpl uses mere 'new Array()' which is incorrect. Sometimes it is really works. I used to write here about this issue and in some places it was fixed. But it turns out that not in all. If I had access to the sources I'd run something like find ol-gwt/src -name '*.java" | xargs sed -i -e'/new Array\(/new \$wnd\.Array\(/g' =) What I do when meet something like that is derive at some safe point and rewrite buggy code. In your case you could create JMyArrayBase and rewrite its constructor in a proper way. If you plan to work tightly with ol-gwt and GWT in whole I'd recommend you to dig deeply into GWT philosophy. There are a lot of material on official GWT page and some independent developers hold their blogs about GWT. Also there are couple of hard-copy books about development with GWT. Without comprehensive understanding of the basic GWT principles it will be very hard to trace the problems which you will (I'm very sure you will) meet. At least it was so for me. -- Sincerely, Alexander |