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

Side by Side Diff: lib/runtime/dart/convert.js

Issue 1093353004: fix list initializers (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: baselines Created 5 years, 8 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 | « lib/runtime/dart/collection.js ('k') | lib/runtime/dart/core.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var convert; 1 var convert;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let ASCII = new AsciiCodec(); 4 let ASCII = new AsciiCodec();
5 let _ASCII_MASK = 127; 5 let _ASCII_MASK = 127;
6 let _allowInvalid = Symbol('_allowInvalid'); 6 let _allowInvalid = Symbol('_allowInvalid');
7 let _nameToEncoding = Symbol('_nameToEncoding'); 7 let _nameToEncoding = Symbol('_nameToEncoding');
8 let Codec$ = dart.generic(function(S, T) { 8 let Codec$ = dart.generic(function(S, T) {
9 class Codec extends core.Object { 9 class Codec extends core.Object {
10 Codec() { 10 Codec() {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 add(source) { 274 add(source) {
275 this.addSlice(source, 0, source[core.$length], false); 275 this.addSlice(source, 0, source[core.$length], false);
276 } 276 }
277 addSlice(source, start, end, isLast) { 277 addSlice(source, start, end, isLast) {
278 core.RangeError.checkValidRange(start, end, source[core.$length]); 278 core.RangeError.checkValidRange(start, end, source[core.$length]);
279 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) { 279 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
280 if ((dart.notNull(source[core.$get](i)) & ~dart.notNull(_ASCII_MASK)) != 0) { 280 if ((dart.notNull(source[core.$get](i)) & ~dart.notNull(_ASCII_MASK)) != 0) {
281 if (dart.notNull(i) > dart.notNull(start)) 281 if (dart.notNull(i) > dart.notNull(start))
282 this[_utf8Sink].addSlice(source, start, i, false); 282 this[_utf8Sink].addSlice(source, start, i, false);
283 this[_utf8Sink].add(/* Unimplemented const */new core.List$(core.int). from([239, 191, 189])); 283 this[_utf8Sink].add(/* Unimplemented const */dart.setType([239, 191, 1 89], core.List$(core.int)));
284 start = dart.notNull(i) + 1; 284 start = dart.notNull(i) + 1;
285 } 285 }
286 } 286 }
287 if (dart.notNull(start) < dart.notNull(end)) { 287 if (dart.notNull(start) < dart.notNull(end)) {
288 this[_utf8Sink].addSlice(source, start, end, isLast); 288 this[_utf8Sink].addSlice(source, start, end, isLast);
289 } else if (isLast) { 289 } else if (isLast) {
290 this.close(); 290 this.close();
291 } 291 }
292 } 292 }
293 } 293 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 _ByteCallbackSink._INITIAL_BUFFER_SIZE = 1024; 371 _ByteCallbackSink._INITIAL_BUFFER_SIZE = 1024;
372 let _ChunkedConversionCallback$ = dart.generic(function(T) { 372 let _ChunkedConversionCallback$ = dart.generic(function(T) {
373 let _ChunkedConversionCallback = dart.typedef('_ChunkedConversionCallback', () => dart.functionType(dart.void, [T])); 373 let _ChunkedConversionCallback = dart.typedef('_ChunkedConversionCallback', () => dart.functionType(dart.void, [T]));
374 return _ChunkedConversionCallback; 374 return _ChunkedConversionCallback;
375 }); 375 });
376 let _ChunkedConversionCallback = _ChunkedConversionCallback$(); 376 let _ChunkedConversionCallback = _ChunkedConversionCallback$();
377 let _accumulated = Symbol('_accumulated'); 377 let _accumulated = Symbol('_accumulated');
378 let _SimpleCallbackSink$ = dart.generic(function(T) { 378 let _SimpleCallbackSink$ = dart.generic(function(T) {
379 class _SimpleCallbackSink extends ChunkedConversionSink$(T) { 379 class _SimpleCallbackSink extends ChunkedConversionSink$(T) {
380 _SimpleCallbackSink(callback) { 380 _SimpleCallbackSink(callback) {
381 this[_accumulated] = new core.List$(T).from([]); 381 this[_accumulated] = dart.setType([], core.List$(T));
382 this[_callback] = callback; 382 this[_callback] = callback;
383 super.ChunkedConversionSink(); 383 super.ChunkedConversionSink();
384 } 384 }
385 add(chunk) { 385 add(chunk) {
386 this[_accumulated][core.$add](chunk); 386 this[_accumulated][core.$add](chunk);
387 } 387 }
388 close() { 388 close() {
389 this[_callback](this[_accumulated]); 389 this[_callback](this[_accumulated]);
390 } 390 }
391 } 391 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 checkAscii: { 731 checkAscii: {
732 for (let i = 0; dart.notNull(i) < dart.notNull(string.length); i = dart. notNull(i) + 1) { 732 for (let i = 0; dart.notNull(i) < dart.notNull(string.length); i = dart. notNull(i) + 1) {
733 if (dart.notNull(string.codeUnitAt(i)) >= 128) 733 if (dart.notNull(string.codeUnitAt(i)) >= 128)
734 break checkAscii; 734 break checkAscii;
735 } 735 }
736 return string.codeUnits; 736 return string.codeUnits;
737 } 737 }
738 return UTF8.encode(string); 738 return UTF8.encode(string);
739 } 739 }
740 convert(object) { 740 convert(object) {
741 let bytes = new core.List$(core.List$(core.int)).from([]); 741 let bytes = dart.setType([], core.List$(core.List$(core.int)));
742 // Function addChunk: (Uint8List, int, int) → void 742 // Function addChunk: (Uint8List, int, int) → void
743 function addChunk(chunk, start, end) { 743 function addChunk(chunk, start, end) {
744 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(chunk[co re.$length])) { 744 if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(chunk[co re.$length])) {
745 let length = dart.notNull(end) - dart.notNull(start); 745 let length = dart.notNull(end) - dart.notNull(start);
746 chunk = new typed_data.Uint8List.view(chunk.buffer, dart.notNull(chunk .offsetInBytes) + dart.notNull(start), length); 746 chunk = new typed_data.Uint8List.view(chunk.buffer, dart.notNull(chunk .offsetInBytes) + dart.notNull(start), length);
747 } 747 }
748 bytes[core.$add](chunk); 748 bytes[core.$add](chunk);
749 } 749 }
750 _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEnco dable$], dart.functionType(dart.dynamic, [core.Object])), this[_bufferSize], add Chunk); 750 _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEnco dable$], dart.functionType(dart.dynamic, [core.Object])), this[_bufferSize], add Chunk);
751 if (bytes[core.$length] == 1) 751 if (bytes[core.$length] == 1)
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 _Latin1AllowInvalidDecoderSink(sink) { 1349 _Latin1AllowInvalidDecoderSink(sink) {
1350 super._Latin1DecoderSink(sink); 1350 super._Latin1DecoderSink(sink);
1351 } 1351 }
1352 addSlice(source, start, end, isLast) { 1352 addSlice(source, start, end, isLast) {
1353 core.RangeError.checkValidRange(start, end, source[core.$length]); 1353 core.RangeError.checkValidRange(start, end, source[core.$length]);
1354 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) { 1354 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
1355 let char = source[core.$get](i); 1355 let char = source[core.$get](i);
1356 if (dart.notNull(char) > dart.notNull(_LATIN1_MASK) || dart.notNull(char ) < 0) { 1356 if (dart.notNull(char) > dart.notNull(_LATIN1_MASK) || dart.notNull(char ) < 0) {
1357 if (dart.notNull(i) > dart.notNull(start)) 1357 if (dart.notNull(i) > dart.notNull(start))
1358 this[_addSliceToSink](source, start, i, false); 1358 this[_addSliceToSink](source, start, i, false);
1359 this[_addSliceToSink](/* Unimplemented const */new core.List$(core.int ).from([65533]), 0, 1, false); 1359 this[_addSliceToSink](/* Unimplemented const */dart.setType([65533], c ore.List$(core.int)), 0, 1, false);
1360 start = dart.notNull(i) + 1; 1360 start = dart.notNull(i) + 1;
1361 } 1361 }
1362 } 1362 }
1363 if (dart.notNull(start) < dart.notNull(end)) { 1363 if (dart.notNull(start) < dart.notNull(end)) {
1364 this[_addSliceToSink](source, start, end, isLast); 1364 this[_addSliceToSink](source, start, end, isLast);
1365 } 1365 }
1366 if (isLast) { 1366 if (isLast) {
1367 this.close(); 1367 this.close();
1368 } 1368 }
1369 } 1369 }
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 } 2116 }
2117 break loop; 2117 break loop;
2118 } 2118 }
2119 if (dart.notNull(expectedUnits) > 0) { 2119 if (dart.notNull(expectedUnits) > 0) {
2120 this[_value] = value; 2120 this[_value] = value;
2121 this[_expectedUnits] = expectedUnits; 2121 this[_expectedUnits] = expectedUnits;
2122 this[_extraUnits] = extraUnits; 2122 this[_extraUnits] = extraUnits;
2123 } 2123 }
2124 } 2124 }
2125 } 2125 }
2126 _Utf8Decoder._LIMITS = /* Unimplemented const */new core.List$(core.int).from( [_ONE_BYTE_LIMIT, _TWO_BYTE_LIMIT, _THREE_BYTE_LIMIT, _FOUR_BYTE_LIMIT]); 2126 _Utf8Decoder._LIMITS = /* Unimplemented const */dart.setType([_ONE_BYTE_LIMIT, _TWO_BYTE_LIMIT, _THREE_BYTE_LIMIT, _FOUR_BYTE_LIMIT], core.List$(core.int));
2127 let _processed = Symbol('_processed'); 2127 let _processed = Symbol('_processed');
2128 let _computeKeys = Symbol('_computeKeys'); 2128 let _computeKeys = Symbol('_computeKeys');
2129 let _original = Symbol('_original'); 2129 let _original = Symbol('_original');
2130 // Function _convertJsonToDart: (dynamic, (dynamic, dynamic) → dynamic) → dyna mic 2130 // Function _convertJsonToDart: (dynamic, (dynamic, dynamic) → dynamic) → dyna mic
2131 function _convertJsonToDart(json, reviver) { 2131 function _convertJsonToDart(json, reviver) {
2132 dart.assert(reviver != null); 2132 dart.assert(reviver != null);
2133 // Function walk: (dynamic) → dynamic 2133 // Function walk: (dynamic) → dynamic
2134 function walk(e) { 2134 function walk(e) {
2135 if (e == null || typeof e != "object") { 2135 if (e == null || typeof e != "object") {
2136 return e; 2136 return e;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 exports.LineSplitter = LineSplitter; 2427 exports.LineSplitter = LineSplitter;
2428 exports.StringConversionSink = StringConversionSink; 2428 exports.StringConversionSink = StringConversionSink;
2429 exports.ClosableStringSink = ClosableStringSink; 2429 exports.ClosableStringSink = ClosableStringSink;
2430 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E; 2430 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E;
2431 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; 2431 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE;
2432 exports.UTF8 = UTF8; 2432 exports.UTF8 = UTF8;
2433 exports.Utf8Codec = Utf8Codec; 2433 exports.Utf8Codec = Utf8Codec;
2434 exports.Utf8Encoder = Utf8Encoder; 2434 exports.Utf8Encoder = Utf8Encoder;
2435 exports.Utf8Decoder = Utf8Decoder; 2435 exports.Utf8Decoder = Utf8Decoder;
2436 })(convert || (convert = {})); 2436 })(convert || (convert = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/collection.js ('k') | lib/runtime/dart/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698