I've run into an issue where I have a JSNI callback function wrapped within
$entry so that exceptions raised by the GWT callback method are propagated
correctly through the GWT exception handling mechanism.
The issue I'm seeing is that in hosted mode when the function that $entry
wraps is returns a boolean 'false' the apply method below gets called via
$entry(..) and it wraps the boolean false value as Object(false). As a
result when this value is passed to external JS is treated as true i,e. if(
Object(false) ) { .. } evaluates as true.
Impl.java:144
private static native Object apply(Object jsFunction, Object thisObj,
Object arguments) /*-{
if (@com.google.gwt.core.client.GWT::isScript()()) {
return jsFunction.apply(thisObj, arguments);
} else {
_ = jsFunction.apply(thisObj, arguments);
if (_ != null) {
// Wrap for hosted mode
_ = Object(_);
}
return _;
}
}-*/;
What is the rationale for this wrapping as Object(..) in hosted mode? And
can you suggest a workaround for this usecase?
Thanks,
Sanjiv
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
To unsubscribe, reply using "remove me" as the subject.