| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |