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

Side by Side Diff: test/codegen/expect/dart/convert.js

Issue 1023543002: Enable inference in the core libs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 | « test/codegen/expect/dart/async.js ('k') | test/codegen/expect/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 class AsciiCodec extends Encoding { 7 class AsciiCodec extends Encoding {
8 AsciiCodec(opt$) { 8 AsciiCodec(opt$) {
9 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d; 9 let allowInvalid = opt$.allowInvalid === void 0 ? false : opt$.allowInvali d;
10 this[_allowInvalid] = allowInvalid; 10 this[_allowInvalid] = allowInvalid;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 close() { 245 close() {
246 return this[_sink].close(); 246 return this[_sink].close();
247 } 247 }
248 } 248 }
249 let _buffer = Symbol('_buffer'); 249 let _buffer = Symbol('_buffer');
250 let _callback = Symbol('_callback'); 250 let _callback = Symbol('_callback');
251 let _bufferIndex = Symbol('_bufferIndex'); 251 let _bufferIndex = Symbol('_bufferIndex');
252 let _roundToPowerOf2 = Symbol('_roundToPowerOf2'); 252 let _roundToPowerOf2 = Symbol('_roundToPowerOf2');
253 class _ByteCallbackSink extends ByteConversionSinkBase { 253 class _ByteCallbackSink extends ByteConversionSinkBase {
254 _ByteCallbackSink(callback) { 254 _ByteCallbackSink(callback) {
255 this[_buffer] = new typed_data.Uint8List(dart.as(_ByteCallbackSink._INITIA L_BUFFER_SIZE, core.int)); 255 this[_buffer] = new typed_data.Uint8List(_ByteCallbackSink._INITIAL_BUFFER _SIZE);
256 this[_callback] = callback; 256 this[_callback] = callback;
257 this[_bufferIndex] = 0; 257 this[_bufferIndex] = 0;
258 super.ByteConversionSinkBase(); 258 super.ByteConversionSinkBase();
259 } 259 }
260 add(chunk) { 260 add(chunk) {
261 let freeCount = dart.notNull(this[_buffer].length) - dart.notNull(this[_bu fferIndex]); 261 let freeCount = dart.notNull(this[_buffer].length) - dart.notNull(this[_bu fferIndex]);
262 if (dart.notNull(chunk.length) > dart.notNull(freeCount)) { 262 if (dart.notNull(chunk.length) > dart.notNull(freeCount)) {
263 let oldLength = this[_buffer].length; 263 let oldLength = this[_buffer].length;
264 let newLength = dart.notNull(_roundToPowerOf2(dart.notNull(chunk.length) + dart.notNull(oldLength))) * 2; 264 let newLength = dart.notNull(_roundToPowerOf2(dart.notNull(chunk.length) + dart.notNull(oldLength))) * 2;
265 let grown = new typed_data.Uint8List(newLength); 265 let grown = new typed_data.Uint8List(newLength);
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 this[_chunkedSink] = $_chunkedSink; 1440 this[_chunkedSink] = $_chunkedSink;
1441 this[_buffer] = new core.StringBuffer(); 1441 this[_buffer] = new core.StringBuffer();
1442 } 1442 }
1443 close() { 1443 close() {
1444 if (this[_buffer].isNotEmpty) 1444 if (this[_buffer].isNotEmpty)
1445 this[_flush](); 1445 this[_flush]();
1446 this[_chunkedSink].close(); 1446 this[_chunkedSink].close();
1447 } 1447 }
1448 writeCharCode(charCode) { 1448 writeCharCode(charCode) {
1449 this[_buffer].writeCharCode(charCode); 1449 this[_buffer].writeCharCode(charCode);
1450 if (this[_buffer].length['>'](_StringConversionSinkAsStringSinkAdapter._MI N_STRING_SIZE)) 1450 if (dart.notNull(this[_buffer].length) > dart.notNull(_StringConversionSin kAsStringSinkAdapter._MIN_STRING_SIZE))
1451 this[_flush](); 1451 this[_flush]();
1452 } 1452 }
1453 write(o) { 1453 write(o) {
1454 if (this[_buffer].isNotEmpty) 1454 if (this[_buffer].isNotEmpty)
1455 this[_flush](); 1455 this[_flush]();
1456 let str = o.toString(); 1456 let str = o.toString();
1457 this[_chunkedSink].add(o.toString()); 1457 this[_chunkedSink].add(o.toString());
1458 } 1458 }
1459 writeln(o) { 1459 writeln(o) {
1460 if (o === void 0) 1460 if (o === void 0)
1461 o = ""; 1461 o = "";
1462 this[_buffer].writeln(o); 1462 this[_buffer].writeln(o);
1463 if (this[_buffer].length['>'](_StringConversionSinkAsStringSinkAdapter._MI N_STRING_SIZE)) 1463 if (dart.notNull(this[_buffer].length) > dart.notNull(_StringConversionSin kAsStringSinkAdapter._MIN_STRING_SIZE))
1464 this[_flush](); 1464 this[_flush]();
1465 } 1465 }
1466 writeAll(objects, separator) { 1466 writeAll(objects, separator) {
1467 if (separator === void 0) 1467 if (separator === void 0)
1468 separator = ""; 1468 separator = "";
1469 if (this[_buffer].isNotEmpty) 1469 if (this[_buffer].isNotEmpty)
1470 this[_flush](); 1470 this[_flush]();
1471 let iterator = objects.iterator; 1471 let iterator = objects.iterator;
1472 if (!dart.notNull(iterator.moveNext())) 1472 if (!dart.notNull(iterator.moveNext()))
1473 return; 1473 return;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 bind(stream) { 1687 bind(stream) {
1688 return dart.as(super.bind(stream), async.Stream$(core.List$(core.int))); 1688 return dart.as(super.bind(stream), async.Stream$(core.List$(core.int)));
1689 } 1689 }
1690 } 1690 }
1691 let _Utf8Encoder$withBufferSize = Symbol('_Utf8Encoder$withBufferSize'); 1691 let _Utf8Encoder$withBufferSize = Symbol('_Utf8Encoder$withBufferSize');
1692 let _createBuffer = Symbol('_createBuffer'); 1692 let _createBuffer = Symbol('_createBuffer');
1693 let _writeSurrogate = Symbol('_writeSurrogate'); 1693 let _writeSurrogate = Symbol('_writeSurrogate');
1694 let _fillBuffer = Symbol('_fillBuffer'); 1694 let _fillBuffer = Symbol('_fillBuffer');
1695 class _Utf8Encoder extends core.Object { 1695 class _Utf8Encoder extends core.Object {
1696 _Utf8Encoder() { 1696 _Utf8Encoder() {
1697 this[_Utf8Encoder$withBufferSize](dart.as(_Utf8Encoder._DEFAULT_BYTE_BUFFE R_SIZE, core.int)); 1697 this[_Utf8Encoder$withBufferSize](_Utf8Encoder._DEFAULT_BYTE_BUFFER_SIZE);
1698 } 1698 }
1699 _Utf8Encoder$withBufferSize(bufferSize) { 1699 _Utf8Encoder$withBufferSize(bufferSize) {
1700 this[_buffer] = _createBuffer(bufferSize); 1700 this[_buffer] = _createBuffer(bufferSize);
1701 this[_carry] = 0; 1701 this[_carry] = 0;
1702 this[_bufferIndex] = 0; 1702 this[_bufferIndex] = 0;
1703 } 1703 }
1704 static [_createBuffer](size) { 1704 static [_createBuffer](size) {
1705 return new typed_data.Uint8List(size); 1705 return new typed_data.Uint8List(size);
1706 } 1706 }
1707 [_writeSurrogate](leadingSurrogate, nextCodeUnit) { 1707 [_writeSurrogate](leadingSurrogate, nextCodeUnit) {
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 exports.ClosableStringSink = ClosableStringSink; 2321 exports.ClosableStringSink = ClosableStringSink;
2322 exports.StringConversionSinkBase = StringConversionSinkBase; 2322 exports.StringConversionSinkBase = StringConversionSinkBase;
2323 exports.StringConversionSinkMixin = StringConversionSinkMixin; 2323 exports.StringConversionSinkMixin = StringConversionSinkMixin;
2324 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E; 2324 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E;
2325 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; 2325 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE;
2326 exports.UTF8 = UTF8; 2326 exports.UTF8 = UTF8;
2327 exports.Utf8Codec = Utf8Codec; 2327 exports.Utf8Codec = Utf8Codec;
2328 exports.Utf8Encoder = Utf8Encoder; 2328 exports.Utf8Encoder = Utf8Encoder;
2329 exports.Utf8Decoder = Utf8Decoder; 2329 exports.Utf8Decoder = Utf8Decoder;
2330 })(convert || (convert = {})); 2330 })(convert || (convert = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/dart/async.js ('k') | test/codegen/expect/dart/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698