Thomas Broyer has posted comments on this change.
Change subject: Use JSON.parse() instead of eval() to deserialize rpc
callback payload
......................................................................
Patch Set 1: Code-Review-2
(2 comments)
AFAICT, this change is kind of useless without some "negotiation" of the
protocol version on the server-side (writing with the same protocol version
as the request used), and deferred-binding on the client-side to use
protocol version 7 on IE6-7 (where JSON.parse is not available; I think we
can safely assume all other browsers have JSON.parse:
http://caniuse.com/json).
This requires a huge refactoring of the server code though.
This change, as is (except entirely removing the eval() codepath), will be
OK in a year from now though, when we'll definitely remove support for
IE6-7 (I though we talked about the end of this year on the SC meeting,
which would rather be GWT 2.6, but IIUC Ray & Daniel's I/O talk they said
GWT 3.0)
....................................................
File
user/src/com/google/gwt/user/client/rpc/impl/AbstractSerializationStreamWriter.java
Line 97: append("0");
That means that infinity and NaN don't roundtrip, which is a breaking
change.
Couldn't we emit "+Infinity", "-Infinity" and "NaN" as strings and modify
ClientSerializationStreamReader to use Number(x) for parsing (will accept
either one of number or string, and act accordingly, parsing "+Infinity"
and "-Infinity" as positive and negative infinity, and failing to
parse "NaN" as a number thus returning NaN; ServerSerializationStreamReader
already does the right thing as it uses Double.parseDouble).
ClientSerializationStreamReader in DevMode could (should?) also use JSON
parsing then.
....................................................
File
user/super/com/google/gwt/user/translatable/com/google/gwt/user/client/rpc/impl/ClientSerializationStreamReader.java
Line 37: private static native JavaScriptObject parse(String encoded) /*-{
We have JsonUtils.safeEval() already.
--
To view, visit https://gwt-review.googlesource.com/2900
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6062180397f5fabed1dd5f08140c2bd43a19fa9f
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Ahlroos <j...@vaadin.com>
Gerrit-Reviewer: Brian Slesinsky <skybr...@google.com>
Gerrit-Reviewer: Colin Alworth <niloc...@gmail.com>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Thomas Broyer <t.bro...@gmail.com>
Gerrit-HasComments: Yes
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
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 email
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.