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

Unified Diff: sdk/lib/json/json.dart

Issue 12114021: Use browsers JSON.parse for parsing JSON. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | tests/json/json_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/json/json.dart
diff --git a/sdk/lib/json/json.dart b/sdk/lib/json/json.dart
index 4348767eea666865b422cd6e22b80c4042b1f1bc..3d2d615b5265fa9ea2ea3f505e2bcc8748687de7 100644
--- a/sdk/lib/json/json.dart
+++ b/sdk/lib/json/json.dart
@@ -35,21 +35,24 @@ class JsonUnsupportedObjectError implements Error {
/**
- * Parses [json] and build the corresponding parsed JSON value.
+ * Parses [json] and builds the corresponding parsed JSON value.
*
* Parsed JSON values are of the types [num], [String], [bool], [Null],
* [List]s of parsed JSON values or [Map]s from [String] to parsed
* JSON values.
*
- * The optional [revivier] function, if provided, is called once for each
- * object or list property parsed. The arguments are the property name
- * ([String]) or list index ([int]), and the value is the parsed value.
- * The return value of the revivier will be used as the value of that property
- * instead the parsed value.
+ * The optional [reviver] function, if provided, is called once for each object
+ * or list property parsed. The arguments are the property name ([String]) or
+ * list index ([int]), and the value is the parsed value. The return value of
+ * the reviver will be used as the value of that property instead of the parsed
+ * value. The top level value is passed to the reviver with the empty string as
+ * a key.
*
* Throws [FormatException] if the input is not valid JSON text.
*/
-parse(String json, [reviver(var key, var value)]) {
+external parse(String json, [reviver(var key, var value)]);
+
+_parse(String json, [reviver(var key, var value)]) {
kasperl 2013/02/06 07:07:11 If this code is only used by the VM, it shouldn't
sra1 2013/02/06 17:22:39 The code can still be used by someone who needs th
BuildJsonListener listener;
if (reviver == null) {
listener = new BuildJsonListener();
« no previous file with comments | « sdk/lib/_internal/libraries.dart ('k') | tests/json/json_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698