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

Side by Side Diff: runtime/lib/convert_patch.dart

Issue 1971193002: Patches to support Dart VM patch files in dart2js. (Closed) Base URL: sso://user/ahe/dart-sdk@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | runtime/lib/core_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import "dart:_internal" show POWERS_OF_TEN; 5 import "dart:_internal" show POWERS_OF_TEN;
6 6
7 // JSON conversion. 7 // JSON conversion.
8 8
9 patch _parseJson(String json, reviver(var key, var value)) { 9 patch _parseJson(String source, reviver(key, value)) {
10 _BuildJsonListener listener; 10 _BuildJsonListener listener;
11 if (reviver == null) { 11 if (reviver == null) {
12 listener = new _BuildJsonListener(); 12 listener = new _BuildJsonListener();
13 } else { 13 } else {
14 listener = new _ReviverJsonListener(reviver); 14 listener = new _ReviverJsonListener(reviver);
15 } 15 }
16 var parser = new _JsonStringParser(listener); 16 var parser = new _JsonStringParser(listener);
17 parser.chunk = json; 17 parser.chunk = source;
18 parser.chunkEnd = json.length; 18 parser.chunkEnd = source.length;
19 parser.parse(0); 19 parser.parse(0);
20 parser.close(); 20 parser.close();
21 return listener.result; 21 return listener.result;
22 } 22 }
23 23
24 patch class Utf8Decoder { 24 patch class Utf8Decoder {
25 /* patch */ 25 /* patch */
26 Converter<List<int>, dynamic> fuse(Converter<String, dynamic> next) { 26 Converter<List<int>, dynamic> fuse(Converter<String, dynamic> next) {
27 if (next is JsonDecoder) { 27 if (next is JsonDecoder) {
28 return new _JsonUtf8Decoder(next._reviver, this._allowMalformed); 28 return new _JsonUtf8Decoder(next._reviver, this._allowMalformed);
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 _parser.parse(start); 1766 _parser.parse(start);
1767 } 1767 }
1768 1768
1769 void close() { 1769 void close() {
1770 _parser.close(); 1770 _parser.close();
1771 var decoded = _parser.result; 1771 var decoded = _parser.result;
1772 _sink.add(decoded); 1772 _sink.add(decoded);
1773 _sink.close(); 1773 _sink.close();
1774 } 1774 }
1775 } 1775 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | runtime/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698