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

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

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 var _js_helper = dart.defineLibrary(_js_helper, {}); 1 var _js_helper = dart.defineLibrary(_js_helper, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var collection = dart.import(collection); 3 var collection = dart.import(collection);
4 var _internal = dart.import(_internal); 4 var _internal = dart.import(_internal);
5 var _foreign_helper = dart.import(_foreign_helper); 5 var _foreign_helper = dart.import(_foreign_helper);
6 var _js_embedded_names = dart.import(_js_embedded_names); 6 var _js_embedded_names = dart.import(_js_embedded_names);
7 var _interceptors = dart.lazyImport(_interceptors); 7 var _interceptors = dart.lazyImport(_interceptors);
8 var _js_names = dart.import(_js_names); 8 var _js_names = dart.import(_js_names);
9 var async = dart.import(async); 9 var async = dart.import(async);
10 var _isolate_helper = dart.lazyImport(_isolate_helper); 10 var _isolate_helper = dart.lazyImport(_isolate_helper);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 addAll(other) { 73 addAll(other) {
74 dart.as(other, core.Map$(K, V)); 74 dart.as(other, core.Map$(K, V));
75 return this[_throwUnmodifiable](); 75 return this[_throwUnmodifiable]();
76 } 76 }
77 } 77 }
78 ConstantMap[dart.implements] = () => [core.Map$(K, V)]; 78 ConstantMap[dart.implements] = () => [core.Map$(K, V)];
79 dart.defineNamedConstructor(ConstantMap, '_'); 79 dart.defineNamedConstructor(ConstantMap, '_');
80 dart.setSignature(ConstantMap, { 80 dart.setSignature(ConstantMap, {
81 methods: () => ({ 81 methods: () => ({
82 toString: dart.functionType(core.String, []),
83 [_throwUnmodifiable]: dart.functionType(dart.dynamic, []), 82 [_throwUnmodifiable]: dart.functionType(dart.dynamic, []),
84 set: dart.functionType(dart.void, [K, V]), 83 set: dart.functionType(dart.void, [K, V]),
85 putIfAbsent: dart.functionType(V, [K, dart.functionType(V, [])]), 84 putIfAbsent: dart.functionType(V, [K, dart.functionType(V, [])]),
86 remove: dart.functionType(V, [core.Object]), 85 remove: dart.functionType(V, [core.Object]),
87 clear: dart.functionType(dart.void, []), 86 clear: dart.functionType(dart.void, []),
88 addAll: dart.functionType(dart.void, [core.Map$(K, V)]) 87 addAll: dart.functionType(dart.void, [core.Map$(K, V)])
89 }) 88 })
90 }); 89 });
91 return ConstantMap; 90 return ConstantMap;
92 }); 91 });
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return false; 160 return false;
162 if (dart.equals('__proto__', key)) 161 if (dart.equals('__proto__', key))
163 return true; 162 return true;
164 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 163 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
165 } 164 }
166 [_fetch](key) { 165 [_fetch](key) {
167 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String)); 166 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String));
168 } 167 }
169 } 168 }
170 dart.defineNamedConstructor(ConstantProtoMap, '_'); 169 dart.defineNamedConstructor(ConstantProtoMap, '_');
171 dart.setSignature(ConstantProtoMap, { 170 dart.setSignature(ConstantProtoMap, {});
172 methods: () => ({
173 containsKey: dart.functionType(core.bool, [core.Object]),
174 [_fetch]: dart.functionType(dart.dynamic, [dart.dynamic])
175 })
176 });
177 return ConstantProtoMap; 171 return ConstantProtoMap;
178 }); 172 });
179 let ConstantProtoMap = ConstantProtoMap$(); 173 let ConstantProtoMap = ConstantProtoMap$();
180 let _map = Symbol('_map'); 174 let _map = Symbol('_map');
181 let _ConstantMapKeyIterable$ = dart.generic(function(K) { 175 let _ConstantMapKeyIterable$ = dart.generic(function(K) {
182 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { 176 class _ConstantMapKeyIterable extends collection.IterableBase$(K) {
183 _ConstantMapKeyIterable(map) { 177 _ConstantMapKeyIterable(map) {
184 this[_map] = map; 178 this[_map] = map;
185 super.IterableBase(); 179 super.IterableBase();
186 } 180 }
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 get isMultiLine() { 624 get isMultiLine() {
631 return this[_isMultiLine]; 625 return this[_isMultiLine];
632 } 626 }
633 get isCaseSensitive() { 627 get isCaseSensitive() {
634 return this[_isCaseSensitive]; 628 return this[_isCaseSensitive];
635 } 629 }
636 } 630 }
637 JSSyntaxRegExp[dart.implements] = () => [core.RegExp]; 631 JSSyntaxRegExp[dart.implements] = () => [core.RegExp];
638 dart.setSignature(JSSyntaxRegExp, { 632 dart.setSignature(JSSyntaxRegExp, {
639 methods: () => ({ 633 methods: () => ({
640 toString: dart.functionType(core.String, []),
641 firstMatch: dart.functionType(core.Match, [core.String]), 634 firstMatch: dart.functionType(core.Match, [core.String]),
642 hasMatch: dart.functionType(core.bool, [core.String]), 635 hasMatch: dart.functionType(core.bool, [core.String]),
643 stringMatch: dart.functionType(core.String, [core.String]), 636 stringMatch: dart.functionType(core.String, [core.String]),
644 allMatches: dart.functionType(core.Iterable$(core.Match), [core.String], [ core.int]), 637 allMatches: dart.functionType(core.Iterable$(core.Match), [core.String], [ core.int]),
645 [_execGlobal]: dart.functionType(core.Match, [core.String, core.int]), 638 [_execGlobal]: dart.functionType(core.Match, [core.String, core.int]),
646 [_execAnchored]: dart.functionType(core.Match, [core.String, core.int]), 639 [_execAnchored]: dart.functionType(core.Match, [core.String, core.int]),
647 matchAsPrefix: dart.functionType(core.Match, [core.String], [core.int]) 640 matchAsPrefix: dart.functionType(core.Match, [core.String], [core.int])
648 }), 641 }),
649 statics: () => ({makeNative: dart.functionType(dart.dynamic, [core.String, c ore.bool, core.bool, core.bool])}), 642 statics: () => ({makeNative: dart.functionType(dart.dynamic, [core.String, c ore.bool, core.bool, core.bool])}),
650 names: ['makeNative'] 643 names: ['makeNative']
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 return this[_unmangledName] = unmangledName; 969 return this[_unmangledName] = unmangledName;
977 } 970 }
978 get hashCode() { 971 get hashCode() {
979 return dart.hashCode(this[_typeName]); 972 return dart.hashCode(this[_typeName]);
980 } 973 }
981 ['=='](other) { 974 ['=='](other) {
982 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload (other, _typeName)); 975 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload (other, _typeName));
983 } 976 }
984 } 977 }
985 TypeImpl[dart.implements] = () => [core.Type]; 978 TypeImpl[dart.implements] = () => [core.Type];
986 dart.setSignature(TypeImpl, { 979 dart.setSignature(TypeImpl, {});
987 methods: () => ({
988 toString: dart.functionType(core.String, []),
989 '==': dart.functionType(core.bool, [dart.dynamic])
990 })
991 });
992 class TypeVariable extends core.Object { 980 class TypeVariable extends core.Object {
993 TypeVariable(owner, name, bound) { 981 TypeVariable(owner, name, bound) {
994 this.owner = owner; 982 this.owner = owner;
995 this.name = name; 983 this.name = name;
996 this.bound = bound; 984 this.bound = bound;
997 } 985 }
998 } 986 }
999 dart.setSignature(TypeVariable, {}); 987 dart.setSignature(TypeVariable, {});
1000 function getMangledTypeName(type) { 988 function getMangledTypeName(type) {
1001 return type[_typeName]; 989 return type[_typeName];
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too few).`); 1688 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too few).`);
1701 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete rCount)) { 1689 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete rCount)) {
1702 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`); 1690 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`);
1703 } 1691 }
1704 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) { 1692 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) {
1705 arguments$[core.$add](getMetadata(this.info.defaultValue(i))); 1693 arguments$[core.$add](getMetadata(this.info.defaultValue(i)));
1706 } 1694 }
1707 return this.jsFunction.apply(receiver, arguments$); 1695 return this.jsFunction.apply(receiver, arguments$);
1708 } 1696 }
1709 } 1697 }
1710 dart.setSignature(CachedCatchAllInvocation, { 1698 dart.setSignature(CachedCatchAllInvocation, {});
1711 methods: () => ({invokeOn: dart.functionType(dart.dynamic, [core.Object, cor e.List])})
1712 });
1713 class CachedNoSuchMethodInvocation extends core.Object { 1699 class CachedNoSuchMethodInvocation extends core.Object {
1714 CachedNoSuchMethodInvocation(interceptor) { 1700 CachedNoSuchMethodInvocation(interceptor) {
1715 this.interceptor = interceptor; 1701 this.interceptor = interceptor;
1716 } 1702 }
1717 get isNoSuchMethod() { 1703 get isNoSuchMethod() {
1718 return true; 1704 return true;
1719 } 1705 }
1720 get isGetterStub() { 1706 get isGetterStub() {
1721 return false; 1707 return false;
1722 } 1708 }
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 this[_method] = match == null ? null : dart.as(match.method, core.String); 2594 this[_method] = match == null ? null : dart.as(match.method, core.String);
2609 super.Error(); 2595 super.Error();
2610 } 2596 }
2611 toString() { 2597 toString() {
2612 if (this[_method] == null) 2598 if (this[_method] == null)
2613 return `NullError: ${this[_message]}`; 2599 return `NullError: ${this[_message]}`;
2614 return `NullError: Cannot call "${this[_method]}" on null`; 2600 return `NullError: Cannot call "${this[_method]}" on null`;
2615 } 2601 }
2616 } 2602 }
2617 NullError[dart.implements] = () => [core.NoSuchMethodError]; 2603 NullError[dart.implements] = () => [core.NoSuchMethodError];
2618 dart.setSignature(NullError, { 2604 dart.setSignature(NullError, {});
2619 methods: () => ({toString: dart.functionType(core.String, [])})
2620 });
2621 class JsNoSuchMethodError extends core.Error { 2605 class JsNoSuchMethodError extends core.Error {
2622 JsNoSuchMethodError(message, match) { 2606 JsNoSuchMethodError(message, match) {
2623 this[_message] = message; 2607 this[_message] = message;
2624 this[_method] = match == null ? null : dart.as(match.method, core.String); 2608 this[_method] = match == null ? null : dart.as(match.method, core.String);
2625 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri ng); 2609 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri ng);
2626 super.Error(); 2610 super.Error();
2627 } 2611 }
2628 toString() { 2612 toString() {
2629 if (this[_method] == null) 2613 if (this[_method] == null)
2630 return `NoSuchMethodError: ${this[_message]}`; 2614 return `NoSuchMethodError: ${this[_message]}`;
2631 if (this[_receiver] == null) { 2615 if (this[_receiver] == null) {
2632 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa ge]})`; 2616 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa ge]})`;
2633 } 2617 }
2634 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece iver]}" ` + `(${this[_message]})`; 2618 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece iver]}" ` + `(${this[_message]})`;
2635 } 2619 }
2636 } 2620 }
2637 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; 2621 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError];
2638 dart.setSignature(JsNoSuchMethodError, { 2622 dart.setSignature(JsNoSuchMethodError, {});
2639 methods: () => ({toString: dart.functionType(core.String, [])})
2640 });
2641 class UnknownJsTypeError extends core.Error { 2623 class UnknownJsTypeError extends core.Error {
2642 UnknownJsTypeError(message) { 2624 UnknownJsTypeError(message) {
2643 this[_message] = message; 2625 this[_message] = message;
2644 super.Error(); 2626 super.Error();
2645 } 2627 }
2646 toString() { 2628 toString() {
2647 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`; 2629 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`;
2648 } 2630 }
2649 } 2631 }
2650 dart.setSignature(UnknownJsTypeError, { 2632 dart.setSignature(UnknownJsTypeError, {});
2651 methods: () => ({toString: dart.functionType(core.String, [])})
2652 });
2653 function unwrapException(ex) { 2633 function unwrapException(ex) {
2654 let saveStackTrace = error => { 2634 let saveStackTrace = error => {
2655 if (dart.is(error, core.Error)) { 2635 if (dart.is(error, core.Error)) {
2656 let thrownStackTrace = error.$thrownJsError; 2636 let thrownStackTrace = error.$thrownJsError;
2657 if (thrownStackTrace == null) { 2637 if (thrownStackTrace == null) {
2658 error.$thrownJsError = ex; 2638 error.$thrownJsError = ex;
2659 } 2639 }
2660 } 2640 }
2661 return error; 2641 return error;
2662 }; 2642 };
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 if (this[_trace] != null) 2720 if (this[_trace] != null)
2741 return this[_trace]; 2721 return this[_trace];
2742 let trace = null; 2722 let trace = null;
2743 if (typeof this[_exception] === "object") { 2723 if (typeof this[_exception] === "object") {
2744 trace = dart.as(this[_exception].stack, core.String); 2724 trace = dart.as(this[_exception].stack, core.String);
2745 } 2725 }
2746 return this[_trace] = trace == null ? '' : trace; 2726 return this[_trace] = trace == null ? '' : trace;
2747 } 2727 }
2748 } 2728 }
2749 _StackTrace[dart.implements] = () => [core.StackTrace]; 2729 _StackTrace[dart.implements] = () => [core.StackTrace];
2750 dart.setSignature(_StackTrace, { 2730 dart.setSignature(_StackTrace, {});
2751 methods: () => ({toString: dart.functionType(core.String, [])})
2752 });
2753 function objectHashCode(object) { 2731 function objectHashCode(object) {
2754 if (dart.notNull(object == null) || typeof object != 'object') { 2732 if (dart.notNull(object == null) || typeof object != 'object') {
2755 return dart.hashCode(object); 2733 return dart.hashCode(object);
2756 } else { 2734 } else {
2757 return Primitives.objectHashCode(object); 2735 return Primitives.objectHashCode(object);
2758 } 2736 }
2759 } 2737 }
2760 dart.fn(objectHashCode, core.int, [dart.dynamic]); 2738 dart.fn(objectHashCode, core.int, [dart.dynamic]);
2761 function fillLiteralMap(keyValuePairs, result) { 2739 function fillLiteralMap(keyValuePairs, result) {
2762 let index = 0; 2740 let index = 0;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 Closure.functionCounter = dart.notNull(x) + 1; 3029 Closure.functionCounter = dart.notNull(x) + 1;
3052 return x; 3030 return x;
3053 })()}` + '}')(); 3031 })()}` + '}')();
3054 } 3032 }
3055 toString() { 3033 toString() {
3056 return "Closure"; 3034 return "Closure";
3057 } 3035 }
3058 } 3036 }
3059 Closure[dart.implements] = () => [core.Function]; 3037 Closure[dart.implements] = () => [core.Function];
3060 dart.setSignature(Closure, { 3038 dart.setSignature(Closure, {
3061 methods: () => ({toString: dart.functionType(core.String, [])}),
3062 statics: () => ({ 3039 statics: () => ({
3063 fromTearOff: dart.functionType(dart.dynamic, [dart.dynamic, core.List, cor e.List, core.bool, dart.dynamic, core.String]), 3040 fromTearOff: dart.functionType(dart.dynamic, [dart.dynamic, core.List, cor e.List, core.bool, dart.dynamic, core.String]),
3064 cspForwardCall: dart.functionType(dart.dynamic, [core.int, core.bool, core .String, dart.dynamic]), 3041 cspForwardCall: dart.functionType(dart.dynamic, [core.int, core.bool, core .String, dart.dynamic]),
3065 forwardCallTo: dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic , core.bool]), 3042 forwardCallTo: dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic , core.bool]),
3066 cspForwardInterceptedCall: dart.functionType(dart.dynamic, [core.int, core .bool, core.String, dart.dynamic]), 3043 cspForwardInterceptedCall: dart.functionType(dart.dynamic, [core.int, core .bool, core.String, dart.dynamic]),
3067 forwardInterceptedCallTo: dart.functionType(dart.dynamic, [dart.dynamic, d art.dynamic]) 3044 forwardInterceptedCallTo: dart.functionType(dart.dynamic, [dart.dynamic, d art.dynamic])
3068 }), 3045 }),
3069 names: ['fromTearOff', 'cspForwardCall', 'forwardCallTo', 'cspForwardInterce ptedCall', 'forwardInterceptedCallTo'] 3046 names: ['fromTearOff', 'cspForwardCall', 'forwardCallTo', 'cspForwardInterce ptedCall', 'forwardInterceptedCallTo']
3070 }); 3047 });
3071 Closure.FUNCTION_INDEX = 0; 3048 Closure.FUNCTION_INDEX = 0;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope rtyNames(template), core.List)); 3119 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope rtyNames(template), core.List));
3143 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = d art.notNull(i) + 1) { 3120 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = d art.notNull(i) + 1) {
3144 let name = names[core.$get](i); 3121 let name = names[core.$get](i);
3145 if (template[name] === fieldName) { 3122 if (template[name] === fieldName) {
3146 return name; 3123 return name;
3147 } 3124 }
3148 } 3125 }
3149 } 3126 }
3150 } 3127 }
3151 dart.setSignature(BoundClosure, { 3128 dart.setSignature(BoundClosure, {
3152 methods: () => ({'==': dart.functionType(core.bool, [dart.dynamic])}),
3153 statics: () => ({ 3129 statics: () => ({
3154 selfOf: dart.functionType(dart.dynamic, [BoundClosure]), 3130 selfOf: dart.functionType(dart.dynamic, [BoundClosure]),
3155 targetOf: dart.functionType(dart.dynamic, [BoundClosure]), 3131 targetOf: dart.functionType(dart.dynamic, [BoundClosure]),
3156 receiverOf: dart.functionType(dart.dynamic, [BoundClosure]), 3132 receiverOf: dart.functionType(dart.dynamic, [BoundClosure]),
3157 nameOf: dart.functionType(dart.dynamic, [BoundClosure]), 3133 nameOf: dart.functionType(dart.dynamic, [BoundClosure]),
3158 selfFieldName: dart.functionType(core.String, []), 3134 selfFieldName: dart.functionType(core.String, []),
3159 receiverFieldName: dart.functionType(core.String, []), 3135 receiverFieldName: dart.functionType(core.String, []),
3160 computeFieldNamed: dart.functionType(core.String, [core.String]) 3136 computeFieldNamed: dart.functionType(core.String, [core.String])
3161 }), 3137 }),
3162 names: ['selfOf', 'targetOf', 'receiverOf', 'nameOf', 'selfFieldName', 'rece iverFieldName', 'computeFieldNamed'] 3138 names: ['selfOf', 'targetOf', 'receiverOf', 'nameOf', 'selfFieldName', 'rece iverFieldName', 'computeFieldNamed']
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
3471 fromMessage(message) { 3447 fromMessage(message) {
3472 this.message = message; 3448 this.message = message;
3473 super.Error(); 3449 super.Error();
3474 } 3450 }
3475 toString() { 3451 toString() {
3476 return this.message; 3452 return this.message;
3477 } 3453 }
3478 } 3454 }
3479 TypeErrorImplementation[dart.implements] = () => [core.TypeError]; 3455 TypeErrorImplementation[dart.implements] = () => [core.TypeError];
3480 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage'); 3456 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage');
3481 dart.setSignature(TypeErrorImplementation, { 3457 dart.setSignature(TypeErrorImplementation, {});
3482 methods: () => ({toString: dart.functionType(core.String, [])})
3483 });
3484 class CastErrorImplementation extends core.Error { 3458 class CastErrorImplementation extends core.Error {
3485 CastErrorImplementation(actualType, expectedType) { 3459 CastErrorImplementation(actualType, expectedType) {
3486 this.message = `CastError: Casting value of type ${actualType} to` + ` inc ompatible type ${expectedType}`; 3460 this.message = `CastError: Casting value of type ${actualType} to` + ` inc ompatible type ${expectedType}`;
3487 super.Error(); 3461 super.Error();
3488 } 3462 }
3489 toString() { 3463 toString() {
3490 return this.message; 3464 return this.message;
3491 } 3465 }
3492 } 3466 }
3493 CastErrorImplementation[dart.implements] = () => [core.CastError]; 3467 CastErrorImplementation[dart.implements] = () => [core.CastError];
3494 dart.setSignature(CastErrorImplementation, { 3468 dart.setSignature(CastErrorImplementation, {});
3495 methods: () => ({toString: dart.functionType(core.String, [])})
3496 });
3497 class FallThroughErrorImplementation extends core.FallThroughError { 3469 class FallThroughErrorImplementation extends core.FallThroughError {
3498 FallThroughErrorImplementation() { 3470 FallThroughErrorImplementation() {
3499 super.FallThroughError(); 3471 super.FallThroughError();
3500 } 3472 }
3501 toString() { 3473 toString() {
3502 return "Switch case fall-through."; 3474 return "Switch case fall-through.";
3503 } 3475 }
3504 } 3476 }
3505 dart.setSignature(FallThroughErrorImplementation, { 3477 dart.setSignature(FallThroughErrorImplementation, {});
3506 methods: () => ({toString: dart.functionType(core.String, [])})
3507 });
3508 function assertHelper(condition) { 3478 function assertHelper(condition) {
3509 if (!(typeof condition == 'boolean')) { 3479 if (!(typeof condition == 'boolean')) {
3510 if (dart.is(condition, core.Function)) 3480 if (dart.is(condition, core.Function))
3511 condition = dart.dcall(condition); 3481 condition = dart.dcall(condition);
3512 if (!(typeof condition == 'boolean')) { 3482 if (!(typeof condition == 'boolean')) {
3513 throw new TypeErrorImplementation(condition, 'bool'); 3483 throw new TypeErrorImplementation(condition, 'bool');
3514 } 3484 }
3515 } 3485 }
3516 if (!dart.equals(true, condition)) 3486 if (!dart.equals(true, condition))
3517 throw new core.AssertionError(); 3487 throw new core.AssertionError();
(...skipping 10 matching lines...) Expand all
3528 dart.fn(throwCyclicInit, dart.void, [core.String]); 3498 dart.fn(throwCyclicInit, dart.void, [core.String]);
3529 class RuntimeError extends core.Error { 3499 class RuntimeError extends core.Error {
3530 RuntimeError(message) { 3500 RuntimeError(message) {
3531 this.message = message; 3501 this.message = message;
3532 super.Error(); 3502 super.Error();
3533 } 3503 }
3534 toString() { 3504 toString() {
3535 return `RuntimeError: ${this.message}`; 3505 return `RuntimeError: ${this.message}`;
3536 } 3506 }
3537 } 3507 }
3538 dart.setSignature(RuntimeError, { 3508 dart.setSignature(RuntimeError, {});
3539 methods: () => ({toString: dart.functionType(core.String, [])})
3540 });
3541 class DeferredNotLoadedError extends core.Error { 3509 class DeferredNotLoadedError extends core.Error {
3542 DeferredNotLoadedError(libraryName) { 3510 DeferredNotLoadedError(libraryName) {
3543 this.libraryName = libraryName; 3511 this.libraryName = libraryName;
3544 super.Error(); 3512 super.Error();
3545 } 3513 }
3546 toString() { 3514 toString() {
3547 return `Deferred library ${this.libraryName} was not loaded.`; 3515 return `Deferred library ${this.libraryName} was not loaded.`;
3548 } 3516 }
3549 } 3517 }
3550 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError]; 3518 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError];
3551 dart.setSignature(DeferredNotLoadedError, { 3519 dart.setSignature(DeferredNotLoadedError, {});
3552 methods: () => ({toString: dart.functionType(core.String, [])})
3553 });
3554 class RuntimeType extends core.Object { 3520 class RuntimeType extends core.Object {
3555 RuntimeType() { 3521 RuntimeType() {
3556 } 3522 }
3557 } 3523 }
3558 dart.setSignature(RuntimeType, {}); 3524 dart.setSignature(RuntimeType, {});
3559 let _isTest = Symbol('_isTest'); 3525 let _isTest = Symbol('_isTest');
3560 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom'); 3526 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom');
3561 let _asCheck = Symbol('_asCheck'); 3527 let _asCheck = Symbol('_asCheck');
3562 let _check = Symbol('_check'); 3528 let _check = Symbol('_check');
3563 let _assertCheck = Symbol('_assertCheck'); 3529 let _assertCheck = Symbol('_assertCheck');
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3697 return result; 3663 return result;
3698 } 3664 }
3699 } 3665 }
3700 dart.setSignature(RuntimeFunctionType, { 3666 dart.setSignature(RuntimeFunctionType, {
3701 methods: () => ({ 3667 methods: () => ({
3702 [_isTest]: dart.functionType(core.bool, [dart.dynamic]), 3668 [_isTest]: dart.functionType(core.bool, [dart.dynamic]),
3703 [_asCheck]: dart.functionType(dart.dynamic, [dart.dynamic]), 3669 [_asCheck]: dart.functionType(dart.dynamic, [dart.dynamic]),
3704 [_assertCheck]: dart.functionType(dart.dynamic, [dart.dynamic]), 3670 [_assertCheck]: dart.functionType(dart.dynamic, [dart.dynamic]),
3705 [_check]: dart.functionType(dart.dynamic, [dart.dynamic, core.bool]), 3671 [_check]: dart.functionType(dart.dynamic, [dart.dynamic, core.bool]),
3706 [_extractFunctionTypeObjectFrom]: dart.functionType(dart.dynamic, [dart.dy namic]), 3672 [_extractFunctionTypeObjectFrom]: dart.functionType(dart.dynamic, [dart.dy namic]),
3707 toRti: dart.functionType(dart.dynamic, []), 3673 toRti: dart.functionType(dart.dynamic, [])
3708 toString: dart.functionType(core.String, [])
3709 }), 3674 }),
3710 statics: () => ({listToRti: dart.functionType(dart.dynamic, [dart.dynamic])} ), 3675 statics: () => ({listToRti: dart.functionType(dart.dynamic, [dart.dynamic])} ),
3711 names: ['listToRti'] 3676 names: ['listToRti']
3712 }); 3677 });
3713 RuntimeFunctionType.inAssert = false; 3678 RuntimeFunctionType.inAssert = false;
3714 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) { 3679 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) {
3715 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null); 3680 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null);
3716 } 3681 }
3717 dart.fn(buildFunctionType, RuntimeFunctionType, [dart.dynamic, dart.dynamic, d art.dynamic]); 3682 dart.fn(buildFunctionType, RuntimeFunctionType, [dart.dynamic, dart.dynamic, d art.dynamic]);
3718 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) { 3683 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) {
(...skipping 13 matching lines...) Expand all
3732 super.RuntimeType(); 3697 super.RuntimeType();
3733 } 3698 }
3734 toString() { 3699 toString() {
3735 return 'dynamic'; 3700 return 'dynamic';
3736 } 3701 }
3737 toRti() { 3702 toRti() {
3738 return null; 3703 return null;
3739 } 3704 }
3740 } 3705 }
3741 dart.setSignature(DynamicRuntimeType, { 3706 dart.setSignature(DynamicRuntimeType, {
3742 methods: () => ({ 3707 methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
3743 toString: dart.functionType(core.String, []),
3744 toRti: dart.functionType(dart.dynamic, [])
3745 })
3746 }); 3708 });
3747 function getDynamicRuntimeType() { 3709 function getDynamicRuntimeType() {
3748 return dart.const(new DynamicRuntimeType()); 3710 return dart.const(new DynamicRuntimeType());
3749 } 3711 }
3750 dart.fn(getDynamicRuntimeType, RuntimeType, []); 3712 dart.fn(getDynamicRuntimeType, RuntimeType, []);
3751 class VoidRuntimeType extends RuntimeType { 3713 class VoidRuntimeType extends RuntimeType {
3752 VoidRuntimeType() { 3714 VoidRuntimeType() {
3753 super.RuntimeType(); 3715 super.RuntimeType();
3754 } 3716 }
3755 toString() { 3717 toString() {
3756 return 'void'; 3718 return 'void';
3757 } 3719 }
3758 toRti() { 3720 toRti() {
3759 return dart.throw_('internal error'); 3721 return dart.throw_('internal error');
3760 } 3722 }
3761 } 3723 }
3762 dart.setSignature(VoidRuntimeType, { 3724 dart.setSignature(VoidRuntimeType, {
3763 methods: () => ({ 3725 methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
3764 toString: dart.functionType(core.String, []),
3765 toRti: dart.functionType(dart.dynamic, [])
3766 })
3767 }); 3726 });
3768 function getVoidRuntimeType() { 3727 function getVoidRuntimeType() {
3769 return dart.const(new VoidRuntimeType()); 3728 return dart.const(new VoidRuntimeType());
3770 } 3729 }
3771 dart.fn(getVoidRuntimeType, RuntimeType, []); 3730 dart.fn(getVoidRuntimeType, RuntimeType, []);
3772 function functionTypeTestMetaHelper() { 3731 function functionTypeTestMetaHelper() {
3773 let dyn = x; 3732 let dyn = x;
3774 let dyn2 = x; 3733 let dyn2 = x;
3775 let fixedListOrNull = dart.as(x, core.List); 3734 let fixedListOrNull = dart.as(x, core.List);
3776 let fixedListOrNull2 = dart.as(x, core.List); 3735 let fixedListOrNull2 = dart.as(x, core.List);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3817 let rti = allClasses[this.name]; 3776 let rti = allClasses[this.name];
3818 if (rti == null) 3777 if (rti == null)
3819 throw `no type for '${this.name}'`; 3778 throw `no type for '${this.name}'`;
3820 return rti; 3779 return rti;
3821 } 3780 }
3822 toString() { 3781 toString() {
3823 return this.name; 3782 return this.name;
3824 } 3783 }
3825 } 3784 }
3826 dart.setSignature(RuntimeTypePlain, { 3785 dart.setSignature(RuntimeTypePlain, {
3827 methods: () => ({ 3786 methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
3828 toRti: dart.functionType(dart.dynamic, []),
3829 toString: dart.functionType(core.String, [])
3830 })
3831 }); 3787 });
3832 class RuntimeTypeGeneric extends RuntimeType { 3788 class RuntimeTypeGeneric extends RuntimeType {
3833 RuntimeTypeGeneric(name, arguments$, rti) { 3789 RuntimeTypeGeneric(name, arguments$, rti) {
3834 this.name = name; 3790 this.name = name;
3835 this.arguments = arguments$; 3791 this.arguments = arguments$;
3836 this.rti = rti; 3792 this.rti = rti;
3837 super.RuntimeType(); 3793 super.RuntimeType();
3838 } 3794 }
3839 toRti() { 3795 toRti() {
3840 if (this.rti != null) 3796 if (this.rti != null)
3841 return this.rti; 3797 return this.rti;
3842 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES); 3798 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES);
3843 let result = [allClasses[this.name]]; 3799 let result = [allClasses[this.name]];
3844 if (dart.dindex(result, 0) == null) { 3800 if (dart.dindex(result, 0) == null) {
3845 throw `no type for '${this.name}<...>'`; 3801 throw `no type for '${this.name}<...>'`;
3846 } 3802 }
3847 for (let argument of this.arguments) { 3803 for (let argument of this.arguments) {
3848 result.push(argument.toRti()); 3804 result.push(argument.toRti());
3849 } 3805 }
3850 return this.rti = result; 3806 return this.rti = result;
3851 } 3807 }
3852 toString() { 3808 toString() {
3853 return `${this.name}<${this.arguments[core.$join](", ")}>`; 3809 return `${this.name}<${this.arguments[core.$join](", ")}>`;
3854 } 3810 }
3855 } 3811 }
3856 dart.setSignature(RuntimeTypeGeneric, { 3812 dart.setSignature(RuntimeTypeGeneric, {
3857 methods: () => ({ 3813 methods: () => ({toRti: dart.functionType(dart.dynamic, [])})
3858 toRti: dart.functionType(dart.dynamic, []),
3859 toString: dart.functionType(core.String, [])
3860 })
3861 }); 3814 });
3862 let _typeData = Symbol('_typeData'); 3815 let _typeData = Symbol('_typeData');
3863 let _cachedToString = Symbol('_cachedToString'); 3816 let _cachedToString = Symbol('_cachedToString');
3864 let _hasReturnType = Symbol('_hasReturnType'); 3817 let _hasReturnType = Symbol('_hasReturnType');
3865 let _returnType = Symbol('_returnType'); 3818 let _returnType = Symbol('_returnType');
3866 let _isVoid = Symbol('_isVoid'); 3819 let _isVoid = Symbol('_isVoid');
3867 let _hasArguments = Symbol('_hasArguments'); 3820 let _hasArguments = Symbol('_hasArguments');
3868 let _hasOptionalArguments = Symbol('_hasOptionalArguments'); 3821 let _hasOptionalArguments = Symbol('_hasOptionalArguments');
3869 let _optionalArguments = Symbol('_optionalArguments'); 3822 let _optionalArguments = Symbol('_optionalArguments');
3870 let _hasNamedArguments = Symbol('_hasNamedArguments'); 3823 let _hasNamedArguments = Symbol('_hasNamedArguments');
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
3955 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType])); 3908 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType]));
3956 } else { 3909 } else {
3957 s = dart.notNull(s) + 'dynamic'; 3910 s = dart.notNull(s) + 'dynamic';
3958 } 3911 }
3959 return this[_cachedToString] = `${s}`; 3912 return this[_cachedToString] = `${s}`;
3960 } 3913 }
3961 } 3914 }
3962 dart.setSignature(FunctionTypeInfoDecoderRing, { 3915 dart.setSignature(FunctionTypeInfoDecoderRing, {
3963 methods: () => ({ 3916 methods: () => ({
3964 toRuntimeType: dart.functionType(RuntimeType, []), 3917 toRuntimeType: dart.functionType(RuntimeType, []),
3965 [_convert]: dart.functionType(core.String, [dart.dynamic]), 3918 [_convert]: dart.functionType(core.String, [dart.dynamic])
3966 toString: dart.functionType(core.String, [])
3967 }) 3919 })
3968 }); 3920 });
3969 class UnimplementedNoSuchMethodError extends core.Error { 3921 class UnimplementedNoSuchMethodError extends core.Error {
3970 UnimplementedNoSuchMethodError(message) { 3922 UnimplementedNoSuchMethodError(message) {
3971 this[_message] = message; 3923 this[_message] = message;
3972 super.Error(); 3924 super.Error();
3973 } 3925 }
3974 toString() { 3926 toString() {
3975 return `Unsupported operation: ${this[_message]}`; 3927 return `Unsupported operation: ${this[_message]}`;
3976 } 3928 }
3977 } 3929 }
3978 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro r]; 3930 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro r];
3979 dart.setSignature(UnimplementedNoSuchMethodError, { 3931 dart.setSignature(UnimplementedNoSuchMethodError, {});
3980 methods: () => ({toString: dart.functionType(core.String, [])})
3981 });
3982 function random64() { 3932 function random64() {
3983 let int32a = Math.random() * 0x100000000 >>> 0; 3933 let int32a = Math.random() * 0x100000000 >>> 0;
3984 let int32b = Math.random() * 0x100000000 >>> 0; 3934 let int32b = Math.random() * 0x100000000 >>> 0;
3985 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; 3935 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296;
3986 } 3936 }
3987 dart.fn(random64, core.int, []); 3937 dart.fn(random64, core.int, []);
3988 function jsonEncodeNative(string) { 3938 function jsonEncodeNative(string) {
3989 return JSON.stringify(string); 3939 return JSON.stringify(string);
3990 } 3940 }
3991 dart.fn(jsonEncodeNative, core.String, [core.String]); 3941 dart.fn(jsonEncodeNative, core.String, [core.String]);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4107 class MainError extends core.Error { 4057 class MainError extends core.Error {
4108 MainError(message) { 4058 MainError(message) {
4109 this[_message] = message; 4059 this[_message] = message;
4110 super.Error(); 4060 super.Error();
4111 } 4061 }
4112 toString() { 4062 toString() {
4113 return `NoSuchMethodError: ${this[_message]}`; 4063 return `NoSuchMethodError: ${this[_message]}`;
4114 } 4064 }
4115 } 4065 }
4116 MainError[dart.implements] = () => [core.NoSuchMethodError]; 4066 MainError[dart.implements] = () => [core.NoSuchMethodError];
4117 dart.setSignature(MainError, { 4067 dart.setSignature(MainError, {});
4118 methods: () => ({toString: dart.functionType(core.String, [])})
4119 });
4120 function missingMain() { 4068 function missingMain() {
4121 throw new MainError("No top-level function named 'main'."); 4069 throw new MainError("No top-level function named 'main'.");
4122 } 4070 }
4123 dart.fn(missingMain, dart.void, []); 4071 dart.fn(missingMain, dart.void, []);
4124 function badMain() { 4072 function badMain() {
4125 throw new MainError("'main' is not a function."); 4073 throw new MainError("'main' is not a function.");
4126 } 4074 }
4127 dart.fn(badMain, dart.void, []); 4075 dart.fn(badMain, dart.void, []);
4128 function mainHasTooManyParameters() { 4076 function mainHasTooManyParameters() {
4129 throw new MainError("'main' expects too many parameters."); 4077 throw new MainError("'main' expects too many parameters.");
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
4357 exports.jsonEncodeNative = jsonEncodeNative; 4305 exports.jsonEncodeNative = jsonEncodeNative;
4358 exports.getIsolateAffinityTag = getIsolateAffinityTag; 4306 exports.getIsolateAffinityTag = getIsolateAffinityTag;
4359 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; 4307 exports.LoadLibraryFunctionType = LoadLibraryFunctionType;
4360 exports.DeferredLoadCallback = DeferredLoadCallback; 4308 exports.DeferredLoadCallback = DeferredLoadCallback;
4361 exports.loadDeferredLibrary = loadDeferredLibrary; 4309 exports.loadDeferredLibrary = loadDeferredLibrary;
4362 exports.MainError = MainError; 4310 exports.MainError = MainError;
4363 exports.missingMain = missingMain; 4311 exports.missingMain = missingMain;
4364 exports.badMain = badMain; 4312 exports.badMain = badMain;
4365 exports.mainHasTooManyParameters = mainHasTooManyParameters; 4313 exports.mainHasTooManyParameters = mainHasTooManyParameters;
4366 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper); 4314 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698