@JsType(isNative = true, namespace = JsPackage.GLOBAL, name="Object")
public class SomeObjLiteral {
}
Calling new on this results in the following javascript code 'new $wnd.Object'. You could just emit {} instead.
It is surprising the number times you see this code especially for React code bases and when dealing with JSON structures.
Is it worth filing an issue?
A quick fix would be, in a linker, to substitute "new $wnd.Object"
with "{}". It's possible to write a peephole pass to fix this in the
Compiler, but I think given the number of people clamoring for GWT 2.8
and the other more pressing issues, this would be low on the totem
pole.
On Sun, May 1, 2016 at 6:30 AM, Paul Stockley <pstoc...@gmail.com> wrote:
> When you define an object literal as
>
> @JsType(isNative = true, namespace = JsPackage.GLOBAL, name="Object")
> public class SomeObjLiteral {
>
> }
>
>
> Calling new on this results in the following javascript code 'new
> $wnd.Object'. You could just emit {} instead.
>
> It is surprising the number times you see this code especially for React
> code bases and when dealing with JSON structures.
>
> Is it worth filing an issue?
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an