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

Side by Side Diff: frog/lib/json_frog.js

Issue 8972004: Rename and fix json frog library in SDK (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // JavaScript implementation of the native methods declared in json.dart. 5 // JavaScript implementation of the native methods declared in json.dart.
6 6
7 // TODO(jmesserly): this needs lots of cleanup. 7 // TODO(jmesserly): this needs lots of cleanup.
8 // Ideally JS objects could be treated as Dart Maps directly, and then we can 8 // Ideally JS objects could be treated as Dart Maps directly, and then we can
9 // really use native JSON.parse and JSON.stringify. 9 // really use native JSON.parse and JSON.stringify.
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Converts only shallowly. 77 // Converts only shallowly.
78 function $convertDartMapToJsObject(map) { 78 function $convertDartMapToJsObject(map) {
79 var obj = {}; 79 var obj = {};
80 var propertyNames = map.getKeys(); 80 var propertyNames = map.getKeys();
81 for (var i = 0, len = propertyNames.length; i < len; i++) { 81 for (var i = 0, len = propertyNames.length; i < len; i++) {
82 var propertyName = propertyNames[i]; 82 var propertyName = propertyNames[i];
83 obj[propertyName] = map.$index(propertyName); 83 obj[propertyName] = map.$index(propertyName);
84 } 84 }
85 return obj; 85 return obj;
86 } 86 }
OLDNEW
« no previous file with comments | « frog/lib/json_frog.dart ('k') | frog/reader.dart » ('j') | tools/create_sdk.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698