Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Issue 23554004: Made old dart:json library use convert to parse JSON. (Closed)

Created:
7 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Made old dart:json library use convert to parse JSON. Moved JSON implementation into convert_patch files. Move error classes into convert library, and reexport from dart:json. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=26767

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addres review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -507 lines) Patch
A + runtime/lib/convert_patch.dart View 1 6 chunks +14 lines, -286 lines 0 comments Download
A + runtime/lib/convert_sources.gypi View 1 chunk +1 line, -1 line 0 comments Download
D runtime/lib/json_patch.dart View 1 chunk +0 lines, -9 lines 0 comments Download
D runtime/lib/json_sources.gypi View 1 chunk +0 lines, -9 lines 0 comments Download
M runtime/vm/bootstrap.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/bootstrap.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/vm.gypi View 6 chunks +43 lines, -43 lines 0 comments Download
A + sdk/lib/_internal/lib/convert_patch.dart View 1 3 chunks +5 lines, -5 lines 0 comments Download
D sdk/lib/_internal/lib/json_patch.dart View 1 chunk +0 lines, -94 lines 0 comments Download
M sdk/lib/_internal/libraries.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/convert/json.dart View 1 3 chunks +46 lines, -2 lines 0 comments Download
M sdk/lib/json/json.dart View 1 2 chunks +5 lines, -52 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
FSchneider, please check VM changes.
7 years, 3 months ago (2013-08-27 13:00:53 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert_patch.dart File sdk/lib/_internal/lib/convert_patch.dart (right): https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert_patch.dart#newcode93 sdk/lib/_internal/lib/convert_patch.dart:93: return revive(null, walk(json)); Let's do this change in ...
7 years, 3 months ago (2013-08-27 13:25:39 UTC) #2
floitsch
Also make sure not to break code because of the conflict dart:convert / dart:json. It ...
7 years, 3 months ago (2013-08-27 13:27:50 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #2 manually as r26767 (presubmit successful).
7 years, 3 months ago (2013-08-28 07:56:32 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert_patch.dart File sdk/lib/_internal/lib/convert_patch.dart (right): https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert_patch.dart#newcode93 sdk/lib/_internal/lib/convert_patch.dart:93: return revive(null, walk(json)); On 2013/08/27 13:25:40, floitsch wrote: > ...
7 years, 3 months ago (2013-08-28 08:02:59 UTC) #5
Lasse Reichstein Nielsen
7 years, 3 months ago (2013-08-28 08:02:59 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert...
File sdk/lib/_internal/lib/convert_patch.dart (right):

https://codereview.chromium.org/23554004/diff/1/sdk/lib/_internal/lib/convert...
sdk/lib/_internal/lib/convert_patch.dart:93: return revive(null, walk(json));
On 2013/08/27 13:25:40, floitsch wrote:
> Let's do this change in a separate CL.
> Otherwise it drowns among all the other changes.

Done.

https://codereview.chromium.org/23554004/diff/1/sdk/lib/convert/json.dart
File sdk/lib/convert/json.dart (right):

https://codereview.chromium.org/23554004/diff/1/sdk/lib/convert/json.dart#new...
sdk/lib/convert/json.dart:13: * method on the object. If that call fails, the
error will be stored in the
I'd say "no".
We should have a function, the opposite of "reviver", which converts
non-JSON-able objects to JSON-able objects. It could default to just calling
toJson() on the object, or we could default to throwing, and have the old
library call it with a function that calls toJson.

We haven't touched "stringify" yet, right?

https://codereview.chromium.org/23554004/diff/1/sdk/lib/convert/json.dart#new...
sdk/lib/convert/json.dart:15: * serializable, the [cause] will be null.
On 2013/08/27 13:25:40, floitsch wrote:
> is `null`.

Done.

https://codereview.chromium.org/23554004/diff/1/sdk/lib/json/json.dart
File sdk/lib/json/json.dart (right):

https://codereview.chromium.org/23554004/diff/1/sdk/lib/json/json.dart#newcode25
sdk/lib/json/json.dart:25: class JsonUnsupportedObjectError extends Error {
Absolutely. Wonder where the export statement got lost.

https://codereview.chromium.org/23554004/diff/1/sdk/lib/json/json.dart#newcode74
sdk/lib/json/json.dart:74: reviver = (key, value) => original(key == null ? "" :
key, value);
On 2013/08/27 13:25:40, floitsch wrote:
> Again: let's make this in a separate CL.

Done.

https://codereview.chromium.org/23554004/diff/1/tests/lib/convert/codec2_test...
File tests/lib/convert/codec2_test.dart (right):

https://codereview.chromium.org/23554004/diff/1/tests/lib/convert/codec2_test...
tests/lib/convert/codec2_test.dart:25: if (k == null) return v;
On 2013/08/27 13:25:40, floitsch wrote:
> next CL.

Done.

https://codereview.chromium.org/23554004/diff/1/tests/lib/convert/codec2_test...
tests/lib/convert/codec2_test.dart:30: if (k == null) return v;
On 2013/08/27 13:25:40, floitsch wrote:
> ditto.

Done.

Powered by Google App Engine
This is Rietveld 408576698