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

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

Issue 1090313002: fixes #52, fields shadowing getters/setters or other fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 this[_sink] = sink; 327 this[_sink] = sink;
328 super.ByteConversionSinkBase(); 328 super.ByteConversionSinkBase();
329 } 329 }
330 add(chunk) { 330 add(chunk) {
331 return this[_sink].add(chunk); 331 return this[_sink].add(chunk);
332 } 332 }
333 close() { 333 close() {
334 return this[_sink].close(); 334 return this[_sink].close();
335 } 335 }
336 } 336 }
337 let _INITIAL_BUFFER_SIZE = Symbol('_INITIAL_BUFFER_SIZE');
337 let _buffer = Symbol('_buffer'); 338 let _buffer = Symbol('_buffer');
338 let _INITIAL_BUFFER_SIZE = Symbol('_INITIAL_BUFFER_SIZE');
339 let _callback = Symbol('_callback'); 339 let _callback = Symbol('_callback');
340 let _bufferIndex = Symbol('_bufferIndex'); 340 let _bufferIndex = Symbol('_bufferIndex');
341 let _roundToPowerOf2 = Symbol('_roundToPowerOf2'); 341 let _roundToPowerOf2 = Symbol('_roundToPowerOf2');
342 class _ByteCallbackSink extends ByteConversionSinkBase { 342 class _ByteCallbackSink extends ByteConversionSinkBase {
343 _ByteCallbackSink(callback) { 343 _ByteCallbackSink(callback) {
344 this[_buffer] = new typed_data.Uint8List(_ByteCallbackSink[_INITIAL_BUFFER _SIZE]); 344 this[_buffer] = new typed_data.Uint8List(_ByteCallbackSink[_INITIAL_BUFFER _SIZE]);
345 this[_callback] = callback; 345 this[_callback] = callback;
346 this[_bufferIndex] = 0; 346 this[_bufferIndex] = 0;
347 super.ByteConversionSinkBase(); 347 super.ByteConversionSinkBase();
348 } 348 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 return dart.as(this[_second].convert(this[_first].convert(input)), T); 487 return dart.as(this[_second].convert(this[_first].convert(input)), T);
488 } 488 }
489 startChunkedConversion(sink) { 489 startChunkedConversion(sink) {
490 return this[_first].startChunkedConversion(this[_second].startChunkedCon version(sink)); 490 return this[_first].startChunkedConversion(this[_second].startChunkedCon version(sink));
491 } 491 }
492 } 492 }
493 return _FusedConverter; 493 return _FusedConverter;
494 }); 494 });
495 let _FusedConverter = _FusedConverter$(); 495 let _FusedConverter = _FusedConverter$();
496 let HTML_ESCAPE = new HtmlEscape(); 496 let HTML_ESCAPE = new HtmlEscape();
497 let escapeLtGt$ = Symbol('escapeLtGt');
498 let escapeQuot$ = Symbol('escapeQuot');
499 let escapeApos$ = Symbol('escapeApos');
500 let escapeSlash$ = Symbol('escapeSlash');
497 let _ = Symbol('_'); 501 let _ = Symbol('_');
498 let _name = Symbol('_name'); 502 let _name = Symbol('_name');
499 class HtmlEscapeMode extends core.Object { 503 class HtmlEscapeMode extends core.Object {
504 get escapeLtGt() {
505 return this[escapeLtGt$];
506 }
507 get escapeQuot() {
508 return this[escapeQuot$];
509 }
510 get escapeApos() {
511 return this[escapeApos$];
512 }
513 get escapeSlash() {
514 return this[escapeSlash$];
515 }
500 [_](name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) { 516 [_](name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) {
501 this[_name] = name; 517 this[_name] = name;
502 this.escapeLtGt = escapeLtGt; 518 this[escapeLtGt$] = escapeLtGt;
503 this.escapeQuot = escapeQuot; 519 this[escapeQuot$] = escapeQuot;
504 this.escapeApos = escapeApos; 520 this[escapeApos$] = escapeApos;
505 this.escapeSlash = escapeSlash; 521 this[escapeSlash$] = escapeSlash;
506 } 522 }
507 toString() { 523 toString() {
508 return this[_name]; 524 return this[_name];
509 } 525 }
510 } 526 }
511 dart.defineNamedConstructor(HtmlEscapeMode, _); 527 dart.defineNamedConstructor(HtmlEscapeMode, _);
512 HtmlEscapeMode.UNKNOWN = new HtmlEscapeMode[_]('unknown', true, true, true, tr ue); 528 HtmlEscapeMode.UNKNOWN = new HtmlEscapeMode[_]('unknown', true, true, true, tr ue);
513 HtmlEscapeMode.ATTRIBUTE = new HtmlEscapeMode[_]('attribute', false, true, fal se, false); 529 HtmlEscapeMode.ATTRIBUTE = new HtmlEscapeMode[_]('attribute', false, true, fal se, false);
514 HtmlEscapeMode.ELEMENT = new HtmlEscapeMode[_]('element', true, false, false, true); 530 HtmlEscapeMode.ELEMENT = new HtmlEscapeMode[_]('element', true, false, false, true);
531 let mode$ = Symbol('mode');
515 let _convert = Symbol('_convert'); 532 let _convert = Symbol('_convert');
516 class HtmlEscape extends Converter$(core.String, core.String) { 533 class HtmlEscape extends Converter$(core.String, core.String) {
534 get mode() {
535 return this[mode$];
536 }
517 HtmlEscape(mode) { 537 HtmlEscape(mode) {
518 if (mode === void 0) 538 if (mode === void 0)
519 mode = HtmlEscapeMode.UNKNOWN; 539 mode = HtmlEscapeMode.UNKNOWN;
520 this.mode = mode; 540 this[mode$] = mode;
521 super.Converter(); 541 super.Converter();
522 } 542 }
523 convert(text) { 543 convert(text) {
524 let val = this[_convert](text, 0, text.length); 544 let val = this[_convert](text, 0, text.length);
525 return val == null ? text : val; 545 return val == null ? text : val;
526 } 546 }
527 [_convert](text, start, end) { 547 [_convert](text, start, end) {
528 let result = null; 548 let result = null;
529 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) { 549 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
530 let ch = core.String.get(text, i); 550 let ch = core.String.get(text, i);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 } else { 622 } else {
603 this[_sink].add(val); 623 this[_sink].add(val);
604 if (isLast) 624 if (isLast)
605 this[_sink].close(); 625 this[_sink].close();
606 } 626 }
607 } 627 }
608 close() { 628 close() {
609 return this[_sink].close(); 629 return this[_sink].close();
610 } 630 }
611 } 631 }
632 let unsupportedObject$ = Symbol('unsupportedObject');
633 let cause$ = Symbol('cause');
612 class JsonUnsupportedObjectError extends core.Error { 634 class JsonUnsupportedObjectError extends core.Error {
635 get unsupportedObject() {
636 return this[unsupportedObject$];
637 }
638 get cause() {
639 return this[cause$];
640 }
613 JsonUnsupportedObjectError(unsupportedObject, opts) { 641 JsonUnsupportedObjectError(unsupportedObject, opts) {
614 let cause = opts && 'cause' in opts ? opts.cause : null; 642 let cause = opts && 'cause' in opts ? opts.cause : null;
615 this.unsupportedObject = unsupportedObject; 643 this[unsupportedObject$] = unsupportedObject;
616 this.cause = cause; 644 this[cause$] = cause;
617 super.Error(); 645 super.Error();
618 } 646 }
619 toString() { 647 toString() {
620 if (this.cause != null) { 648 if (this.cause != null) {
621 return "Converting object to an encodable object failed."; 649 return "Converting object to an encodable object failed.";
622 } else { 650 } else {
623 return "Converting object did not return an encodable object."; 651 return "Converting object did not return an encodable object.";
624 } 652 }
625 } 653 }
626 } 654 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 return new JsonEncoder(); 697 return new JsonEncoder();
670 return new JsonEncoder(dart.as(this[_toEncodable$], dart.functionType(core .Object, [core.Object]))); 698 return new JsonEncoder(dart.as(this[_toEncodable$], dart.functionType(core .Object, [core.Object])));
671 } 699 }
672 get decoder() { 700 get decoder() {
673 if (this[_reviver] == null) 701 if (this[_reviver] == null)
674 return new JsonDecoder(); 702 return new JsonDecoder();
675 return new JsonDecoder(this[_reviver]); 703 return new JsonDecoder(this[_reviver]);
676 } 704 }
677 } 705 }
678 dart.defineNamedConstructor(JsonCodec, 'withReviver'); 706 dart.defineNamedConstructor(JsonCodec, 'withReviver');
707 let indent$ = Symbol('indent');
679 let _utf8Encode = Symbol('_utf8Encode'); 708 let _utf8Encode = Symbol('_utf8Encode');
680 class JsonEncoder extends Converter$(core.Object, core.String) { 709 class JsonEncoder extends Converter$(core.Object, core.String) {
710 get indent() {
711 return this[indent$];
712 }
681 JsonEncoder(toEncodable) { 713 JsonEncoder(toEncodable) {
682 if (toEncodable === void 0) 714 if (toEncodable === void 0)
683 toEncodable = null; 715 toEncodable = null;
684 this.indent = null; 716 this[indent$] = null;
685 this[_toEncodable$] = toEncodable; 717 this[_toEncodable$] = toEncodable;
686 super.Converter(); 718 super.Converter();
687 } 719 }
688 withIndent(indent, toEncodable) { 720 withIndent(indent, toEncodable) {
689 if (toEncodable === void 0) 721 if (toEncodable === void 0)
690 toEncodable = null; 722 toEncodable = null;
691 this.indent = indent; 723 this[indent$] = indent;
692 this[_toEncodable$] = toEncodable; 724 this[_toEncodable$] = toEncodable;
693 super.Converter(); 725 super.Converter();
694 } 726 }
695 convert(object) { 727 convert(object) {
696 return _JsonStringStringifier.stringify(object, dart.as(this[_toEncodable$ ], dart.functionType(dart.dynamic, [dart.dynamic])), this.indent); 728 return _JsonStringStringifier.stringify(object, dart.as(this[_toEncodable$ ], dart.functionType(dart.dynamic, [dart.dynamic])), this.indent);
697 } 729 }
698 startChunkedConversion(sink) { 730 startChunkedConversion(sink) {
699 if (!dart.is(sink, StringConversionSink)) { 731 if (!dart.is(sink, StringConversionSink)) {
700 sink = new StringConversionSink.from(sink); 732 sink = new StringConversionSink.from(sink);
701 } else if (dart.is(sink, _Utf8EncoderSink)) { 733 } else if (dart.is(sink, _Utf8EncoderSink)) {
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 exports.LineSplitter = LineSplitter; 2466 exports.LineSplitter = LineSplitter;
2435 exports.StringConversionSink = StringConversionSink; 2467 exports.StringConversionSink = StringConversionSink;
2436 exports.ClosableStringSink = ClosableStringSink; 2468 exports.ClosableStringSink = ClosableStringSink;
2437 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E; 2469 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E;
2438 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; 2470 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE;
2439 exports.UTF8 = UTF8; 2471 exports.UTF8 = UTF8;
2440 exports.Utf8Codec = Utf8Codec; 2472 exports.Utf8Codec = Utf8Codec;
2441 exports.Utf8Encoder = Utf8Encoder; 2473 exports.Utf8Encoder = Utf8Encoder;
2442 exports.Utf8Decoder = Utf8Decoder; 2474 exports.Utf8Decoder = Utf8Decoder;
2443 })(convert || (convert = {})); 2475 })(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