google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

com.google.gwt.core.client.JavaScriptObject is missing creation methods #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The com.octo.gwt.test.internal.patchers.JavaScriptObjectPatcher does provide a 
patch for createArray, but neither for createObject nor createFunction. In our 
application, createObject is used and therefore fails using gwt-test-utils.

Package: gwt-test-utils-0.28.6-20110814.175335-12.jar

Original issue reported on code.google.com by stefan.s...@googlemail.com on 15 Aug 2011 at 1:21

GoogleCodeExporter commented 9 years ago
The problem with JavaScriptObject methods is that gwt-test-utils is not 
patching type overlay nicely. In consequence, if I would provide a 
createObject() implementation which would return an instance of 
JavaScriptObject, you won't be able to use the JavaScriptObject.cast() method 
to cast to a subtype of JSO.

The better implementation of type Overlay in gwt-test-utils is in our roadmap, 
but it will take some time to get something working... 
Meanwhile, would a first implement which would return a JSO instance (or an 
Element instance to able cast() to an Element instance) help you to come across 
your gwt-test-utils failure ?

Original comment by gael.laz...@gmail.com on 15 Aug 2011 at 2:38

GoogleCodeExporter commented 9 years ago
Well, our current patch does just that (i.e., return a JSO instance). Maybe, 
our code did not pass a location that needs the casting.
I didn't see the connection to the roadmap, so you might be right with 
postponing a proper fix. We can live with our local patch for now. :)

Original comment by stefan.s...@googlemail.com on 15 Aug 2011 at 2:51

GoogleCodeExporter commented 9 years ago
So I finally added @PatchMethod for JSO.createObject() and 
JSO.createFunction(), which just return an empty JavaScriptObject instance like 
your local patch does.

Those patches will not change when I will have a complete Overlay type 
implementation working.

I've deployed new snapshots with the fix, could you please give me some 
feedback so I could close the issue ?

Original comment by gael.laz...@gmail.com on 21 Aug 2011 at 9:09

GoogleCodeExporter commented 9 years ago
Works perfectly fine now. Thanks.

Using: gwt-test-utils-0.28.6-20110822.061452-16.jar

Original comment by stefan.s...@googlemail.com on 22 Aug 2011 at 7:37

GoogleCodeExporter commented 9 years ago
thanks again !

Original comment by gael.laz...@gmail.com on 22 Aug 2011 at 7:47