| Index: sdk/lib/_internal/lib/json_patch.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/lib/json_patch.dart (revision 24212)
|
| +++ sdk/lib/_internal/lib/json_patch.dart (working copy)
|
| @@ -5,6 +5,7 @@
|
| // Patch file for dart:json library.
|
|
|
| import 'dart:_foreign_helper' show JS;
|
| +import 'dart:_interceptors' show JSExtendableArray;
|
|
|
| /**
|
| * Parses [json] and builds the corresponding parsed JSON value.
|
| @@ -27,7 +28,9 @@
|
|
|
| var parsed;
|
| try {
|
| - parsed = JS('=Object|=List|Null|bool|num|String', 'JSON.parse(#)', json);
|
| + parsed = JS('=Object|JSExtendableArray|Null|bool|num|String',
|
| + 'JSON.parse(#)',
|
| + json);
|
| } catch (e) {
|
| throw new FormatException(JS('String', 'String(#)', e));
|
| }
|
| @@ -54,7 +57,7 @@
|
| // TODO(sra): Replace this test with cheaper '#.constructor === Array' when
|
| // bug 621 below is fixed.
|
| if (JS('bool', 'Object.getPrototypeOf(#) === Array.prototype', e)) {
|
| - var list = JS('=List', '#', e); // Teach compiler the type is known.
|
| + var list = JS('JSExtendableArray', '#', e); // Teach compiler the type is known.
|
| // In-place update of the elements since JS Array is a Dart List.
|
| for (int i = 0; i < list.length; i++) {
|
| // Use JS indexing to avoid range checks. We know this is the only
|
| @@ -69,7 +72,7 @@
|
| }
|
|
|
| // Otherwise it is a plain Object, so copy to a Map.
|
| - var keys = JS('=List', 'Object.keys(#)', e);
|
| + var keys = JS('JSExtendableArray', 'Object.keys(#)', e);
|
| Map map = {};
|
| for (int i = 0; i < keys.length; i++) {
|
| String key = keys[i];
|
|
|