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

Issue 1153893004: In JsonEncoder, test if map has only string keys, and use toEncodable if not. (Closed)

Created:
5 years, 7 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 7 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

In JsonEncoder, test if map has only string keys, and use toEncodable if not. Currently the encoder assumes that a map will have string keys, and will fail in ugly ways if it doesn't. With this change, the toEncodable function used on other un-encodable values is also used on non-String-keyed maps. BUG= http://dartbug.com/23469 R=sgjesse@google.com Committed: https://github.com/dart-lang/sdk/commit/25a16a39b351f6716d4197ae92f86396b6fa97d1

Patch Set 1 #

Total comments: 1

Patch Set 2 : Address comments. #

Patch Set 3 : Also fix pretty-printer. #

Total comments: 1

Patch Set 4 : Address comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -27 lines) Patch
M sdk/lib/convert/json.dart View 1 2 3 chunks +54 lines, -27 lines 0 comments Download
M tests/lib/convert/json_toEncodable_reviver_test.dart View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Lasse Reichstein Nielsen
5 years, 7 months ago (2015-05-26 11:40:09 UTC) #2
Søren Gjesse
lgtm https://codereview.chromium.org/1153893004/diff/1/sdk/lib/convert/json.dart File sdk/lib/convert/json.dart (right): https://codereview.chromium.org/1153893004/diff/1/sdk/lib/convert/json.dart#newcode697 sdk/lib/convert/json.dart:697: var result = writeMap(object); result -> success
5 years, 7 months ago (2015-05-26 14:54:01 UTC) #3
Lasse Reichstein Nielsen
PTAL
5 years, 7 months ago (2015-05-27 08:42:18 UTC) #4
Søren Gjesse
lgtm https://codereview.chromium.org/1153893004/diff/40001/tests/lib/convert/json_toEncodable_reviver_test.dart File tests/lib/convert/json_toEncodable_reviver_test.dart (right): https://codereview.chromium.org/1153893004/diff/40001/tests/lib/convert/json_toEncodable_reviver_test.dart#newcode48 tests/lib/convert/json_toEncodable_reviver_test.dart:48: var enc = new JsonEncoder((x) => "fixed"); x ...
5 years, 7 months ago (2015-05-27 08:45:04 UTC) #5
Lasse Reichstein Nielsen
5 years, 7 months ago (2015-05-27 08:49:25 UTC) #6
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
25a16a39b351f6716d4197ae92f86396b6fa97d1 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698