Reviewers: scottb,

Message:
Ready for first round of reviews.


http://gwt-code-reviews.appspot.com/473801/diff/1/11
File
dev/core/src/com/google/gwt/dev/shell/rewrite/SingleJsoImplSupport.java
(right):

http://gwt-code-reviews.appspot.com/473801/diff/1/11#newcode29
dev/core/src/com/google/gwt/dev/shell/rewrite/SingleJsoImplSupport.java:29:
public class SingleJsoImplSupport {
This class isn't strictly necessary.  All of the reflection operations
could be moved into the generated adjunct types.  Thoughts on whether or
not to keep this?

http://gwt-code-reviews.appspot.com/473801/diff/1/11#newcode57
dev/core/src/com/google/gwt/dev/shell/rewrite/SingleJsoImplSupport.java:57:
// XXX better error message?
How should this failure be communicated to the user?

http://gwt-code-reviews.appspot.com/473801/diff/1/11#newcode66
dev/core/src/com/google/gwt/dev/shell/rewrite/SingleJsoImplSupport.java:66:
throw new ClassCastException();
Will fix this to return o to the original callsite to trigger
ClassCastException at the expected source location.

http://gwt-code-reviews.appspot.com/473801/diff/1/14
File user/src/com/google/gwt/user/client/DOM.java (right):

http://gwt-code-reviews.appspot.com/473801/diff/1/14#newcode750
user/src/com/google/gwt/user/client/DOM.java:750: return (Element)
Document.get().getElementById(id);
Updates in DOM are due to new, correct, NPE behavior in DevMode.

Description:
This patch is part of SuperDevMode and reimplements JavaScriptObject
support in DevMode.  The big architectural change is making the JSO
bytecode rewriting no longer dependent on having global knowledge of all
JSO types.  Instead of having a single JavaScriptObject$ type, the
declared JSO type hierarchy will be maintained in DevMode.

User-visible impact:
  - Generators can generate JSO subtypes that implement interfaces
(anyone want to write a lighweight JSON generator?).
  - The wrapper type last used to access a JSO (such as ButtonElement)
will show in the Java debugger instead of JavaScriptObject$.

Things that look like bugs, but aren't:
  - Invoking a method on a null JavaScriptObject reference will result
in a NullPointerException.  This means that jso.cast() will fail if jso
is null.

Possible breaking changes:
  - Simply casting a JSO to a SingleJsoImpl interface will not work
unless the implementing JSO type has been loaded.  This shouldn't be a
problem in practice as long as the JSO construction method returns the
JSO type.

See also http://gwt-code-reviews.appspot.com/472801 for a demo of being
able to generate JSO subtypes.

Full design doc will be copied to the GWT project wiki.


Please review this at http://gwt-code-reviews.appspot.com/473801/show

Affected files:
  M dev/core/src/com/google/gwt/core/ext/typeinfo/TypeOracle.java
  M dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java
  M dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
  M dev/core/src/com/google/gwt/dev/shell/JsValueGlue.java
M dev/core/src/com/google/gwt/dev/shell/rewrite/HostedModeClassRewriter.java
  A dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsoCasts.java
A dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteObjectComparisons.java D dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteRefsToJsoClasses.java D dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java
  A dev/core/src/com/google/gwt/dev/shell/rewrite/SingleJsoImplSupport.java
  M dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java
A dev/core/src/com/google/gwt/dev/shell/rewrite/WriteSingleJsoSupportCode.java
  M user/src/com/google/gwt/user/client/DOM.java
  M user/src/com/google/gwt/user/client/ui/RootPanel.java
  M user/src/com/google/gwt/user/client/ui/Widget.java
  M user/test/com/google/gwt/dev/jjs/test/JsoTest.java
  M user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to