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

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

Issue 1042943003: fixes private named constructors (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/_isolate_helper.js ('k') | lib/runtime/dart/_native_typed_data.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 _js_helper; 1 var _js_helper;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class NoSideEffects extends core.Object { 4 class NoSideEffects extends core.Object {
5 NoSideEffects() { 5 NoSideEffects() {
6 } 6 }
7 } 7 }
8 class NoThrows extends core.Object { 8 class NoThrows extends core.Object {
9 NoThrows() { 9 NoThrows() {
10 } 10 }
11 } 11 }
12 class NoInline extends core.Object { 12 class NoInline extends core.Object {
13 NoInline() { 13 NoInline() {
14 } 14 }
15 } 15 }
16 class IrRepresentation extends core.Object { 16 class IrRepresentation extends core.Object {
17 IrRepresentation(value) { 17 IrRepresentation(value) {
18 this.value = value; 18 this.value = value;
19 } 19 }
20 } 20 }
21 class Native extends core.Object { 21 class Native extends core.Object {
22 Native(name) { 22 Native(name) {
23 this.name = name; 23 this.name = name;
24 } 24 }
25 } 25 }
26 let _$ = Symbol('_');
26 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); 27 let _throwUnmodifiable = Symbol('_throwUnmodifiable');
27 let _$ = Symbol('_');
28 let ConstantMap$ = dart.generic(function(K, V) { 28 let ConstantMap$ = dart.generic(function(K, V) {
29 class ConstantMap extends core.Object { 29 class ConstantMap extends core.Object {
30 ConstantMap$_() { 30 [_$]() {
31 } 31 }
32 get isEmpty() { 32 get isEmpty() {
33 return this.length === 0; 33 return this.length === 0;
34 } 34 }
35 get isNotEmpty() { 35 get isNotEmpty() {
36 return !dart.notNull(this.isEmpty); 36 return !dart.notNull(this.isEmpty);
37 } 37 }
38 toString() { 38 toString() {
39 return collection.Maps.mapToString(this); 39 return collection.Maps.mapToString(this);
40 } 40 }
(...skipping 18 matching lines...) Expand all
59 } 59 }
60 dart.defineNamedConstructor(ConstantMap, _$); 60 dart.defineNamedConstructor(ConstantMap, _$);
61 return ConstantMap; 61 return ConstantMap;
62 }); 62 });
63 let ConstantMap = ConstantMap$(dart.dynamic, dart.dynamic); 63 let ConstantMap = ConstantMap$(dart.dynamic, dart.dynamic);
64 let _jsObject = Symbol('_jsObject'); 64 let _jsObject = Symbol('_jsObject');
65 let _keys = Symbol('_keys'); 65 let _keys = Symbol('_keys');
66 let _fetch = Symbol('_fetch'); 66 let _fetch = Symbol('_fetch');
67 let ConstantStringMap$ = dart.generic(function(K, V) { 67 let ConstantStringMap$ = dart.generic(function(K, V) {
68 class ConstantStringMap extends ConstantMap$(K, V) { 68 class ConstantStringMap extends ConstantMap$(K, V) {
69 ConstantStringMap$_(length, jsObject$, keys$) { 69 [_$](length, jsObject$, keys$) {
70 this.length = length; 70 this.length = length;
71 this[_jsObject] = jsObject$; 71 this[_jsObject] = jsObject$;
72 this[_keys] = keys$; 72 this[_keys] = keys$;
73 super.ConstantMap$_(); 73 super[_$]();
74 } 74 }
75 containsValue(needle) { 75 containsValue(needle) {
76 return this.values.any((value) => dart.equals(value, needle)); 76 return this.values.any((value) => dart.equals(value, needle));
77 } 77 }
78 containsKey(key) { 78 containsKey(key) {
79 if (!(typeof key == 'string')) 79 if (!(typeof key == 'string'))
80 return false; 80 return false;
81 if (dart.equals('__proto__', key)) 81 if (dart.equals('__proto__', key))
82 return false; 82 return false;
83 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 83 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
(...skipping 20 matching lines...) Expand all
104 return new _internal.MappedIterable(this[_keys], dart.closureWrap(((key) => this[_fetch](key)).bind(this), "(K) → V")); 104 return new _internal.MappedIterable(this[_keys], dart.closureWrap(((key) => this[_fetch](key)).bind(this), "(K) → V"));
105 } 105 }
106 } 106 }
107 dart.defineNamedConstructor(ConstantStringMap, _$); 107 dart.defineNamedConstructor(ConstantStringMap, _$);
108 return ConstantStringMap; 108 return ConstantStringMap;
109 }); 109 });
110 let ConstantStringMap = ConstantStringMap$(dart.dynamic, dart.dynamic); 110 let ConstantStringMap = ConstantStringMap$(dart.dynamic, dart.dynamic);
111 let _protoValue = Symbol('_protoValue'); 111 let _protoValue = Symbol('_protoValue');
112 let ConstantProtoMap$ = dart.generic(function(K, V) { 112 let ConstantProtoMap$ = dart.generic(function(K, V) {
113 class ConstantProtoMap extends ConstantStringMap$(K, V) { 113 class ConstantProtoMap extends ConstantStringMap$(K, V) {
114 ConstantProtoMap$_(length, jsObject, keys, protoValue) { 114 [_$](length, jsObject, keys, protoValue) {
115 this[_protoValue] = protoValue; 115 this[_protoValue] = protoValue;
116 super.ConstantStringMap$_(dart.as(length, core.int), jsObject, dart.as(k eys, core.List$(K))); 116 super[_$](dart.as(length, core.int), jsObject, dart.as(keys, core.List$( K)));
117 } 117 }
118 containsKey(key) { 118 containsKey(key) {
119 if (!(typeof key == 'string')) 119 if (!(typeof key == 'string'))
120 return false; 120 return false;
121 if (dart.equals('__proto__', key)) 121 if (dart.equals('__proto__', key))
122 return true; 122 return true;
123 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 123 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
124 } 124 }
125 [_fetch](key) { 125 [_fetch](key) {
126 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String)); 126 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String));
(...skipping 19 matching lines...) Expand all
146 } 146 }
147 return _ConstantMapKeyIterable; 147 return _ConstantMapKeyIterable;
148 }); 148 });
149 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(dart.dynamic); 149 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(dart.dynamic);
150 let _jsData = Symbol('_jsData'); 150 let _jsData = Symbol('_jsData');
151 let _getMap = Symbol('_getMap'); 151 let _getMap = Symbol('_getMap');
152 let GeneralConstantMap$ = dart.generic(function(K, V) { 152 let GeneralConstantMap$ = dart.generic(function(K, V) {
153 class GeneralConstantMap extends ConstantMap$(K, V) { 153 class GeneralConstantMap extends ConstantMap$(K, V) {
154 GeneralConstantMap(jsData) { 154 GeneralConstantMap(jsData) {
155 this[_jsData] = jsData; 155 this[_jsData] = jsData;
156 super.ConstantMap$_(); 156 super[_$]();
157 } 157 }
158 [_getMap]() { 158 [_getMap]() {
159 if (!this.$map) { 159 if (!this.$map) {
160 let backingMap = new collection.LinkedHashMap(); 160 let backingMap = new collection.LinkedHashMap();
161 this.$map = fillLiteralMap(this[_jsData], backingMap); 161 this.$map = fillLiteralMap(this[_jsData], backingMap);
162 } 162 }
163 return this.$map; 163 return this.$map;
164 } 164 }
165 containsValue(needle) { 165 containsValue(needle) {
166 return this[_getMap]().containsValue(needle); 166 return this[_getMap]().containsValue(needle);
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 } 1591 }
1592 get isGetterStub() { 1592 get isGetterStub() {
1593 return false; 1593 return false;
1594 } 1594 }
1595 invokeOn(victim, invocation) { 1595 invokeOn(victim, invocation) {
1596 let receiver = this.interceptor === null ? victim : this.interceptor; 1596 let receiver = this.interceptor === null ? victim : this.interceptor;
1597 return dart.dinvoke(receiver, 'noSuchMethod', invocation); 1597 return dart.dinvoke(receiver, 'noSuchMethod', invocation);
1598 } 1598 }
1599 } 1599 }
1600 class ReflectionInfo extends core.Object { 1600 class ReflectionInfo extends core.Object {
1601 ReflectionInfo$internal(jsFunction, data, isAccessor, requiredParameterCount , optionalParameterCount, areOptionalParametersNamed, functionType) { 1601 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam eterCount, areOptionalParametersNamed, functionType) {
1602 this.jsFunction = jsFunction; 1602 this.jsFunction = jsFunction;
1603 this.data = data; 1603 this.data = data;
1604 this.isAccessor = isAccessor; 1604 this.isAccessor = isAccessor;
1605 this.requiredParameterCount = requiredParameterCount; 1605 this.requiredParameterCount = requiredParameterCount;
1606 this.optionalParameterCount = optionalParameterCount; 1606 this.optionalParameterCount = optionalParameterCount;
1607 this.areOptionalParametersNamed = areOptionalParametersNamed; 1607 this.areOptionalParametersNamed = areOptionalParametersNamed;
1608 this.functionType = functionType; 1608 this.functionType = functionType;
1609 this.cachedSortedIndices = null; 1609 this.cachedSortedIndices = null;
1610 } 1610 }
1611 ReflectionInfo(jsFunction) { 1611 ReflectionInfo(jsFunction) {
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable { 3173 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {
3174 } 3174 }
3175 return JavaScriptIndexingBehavior; 3175 return JavaScriptIndexingBehavior;
3176 } 3176 }
3177 }); 3177 });
3178 class TypeErrorImplementation extends core.Error { 3178 class TypeErrorImplementation extends core.Error {
3179 TypeErrorImplementation(value, type) { 3179 TypeErrorImplementation(value, type) {
3180 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`; 3180 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`;
3181 super.Error(); 3181 super.Error();
3182 } 3182 }
3183 TypeErrorImplementation$fromMessage(message) { 3183 fromMessage(message) {
3184 this.message = message; 3184 this.message = message;
3185 super.Error(); 3185 super.Error();
3186 } 3186 }
3187 toString() { 3187 toString() {
3188 return this.message; 3188 return this.message;
3189 } 3189 }
3190 } 3190 }
3191 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage'); 3191 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage');
3192 class CastErrorImplementation extends core.Error { 3192 class CastErrorImplementation extends core.Error {
3193 CastErrorImplementation(actualType, expectedType) { 3193 CastErrorImplementation(actualType, expectedType) {
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
3985 exports.UnimplementedNoSuchMethodError = UnimplementedNoSuchMethodError; 3985 exports.UnimplementedNoSuchMethodError = UnimplementedNoSuchMethodError;
3986 exports.random64 = random64; 3986 exports.random64 = random64;
3987 exports.jsonEncodeNative = jsonEncodeNative; 3987 exports.jsonEncodeNative = jsonEncodeNative;
3988 exports.getIsolateAffinityTag = getIsolateAffinityTag; 3988 exports.getIsolateAffinityTag = getIsolateAffinityTag;
3989 exports.loadDeferredLibrary = loadDeferredLibrary; 3989 exports.loadDeferredLibrary = loadDeferredLibrary;
3990 exports.MainError = MainError; 3990 exports.MainError = MainError;
3991 exports.missingMain = missingMain; 3991 exports.missingMain = missingMain;
3992 exports.badMain = badMain; 3992 exports.badMain = badMain;
3993 exports.mainHasTooManyParameters = mainHasTooManyParameters; 3993 exports.mainHasTooManyParameters = mainHasTooManyParameters;
3994 })(_js_helper || (_js_helper = {})); 3994 })(_js_helper || (_js_helper = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/_native_typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698