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

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

Issue 1085723002: fixes for angular hello: String + and disable broken arg parsing (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/async.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 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 get(key) { 86 get(key) {
87 if (!dart.notNull(this.containsKey(key))) 87 if (!dart.notNull(this.containsKey(key)))
88 return null; 88 return null;
89 return dart.as(this[_fetch](key), V); 89 return dart.as(this[_fetch](key), V);
90 } 90 }
91 [_fetch](key) { 91 [_fetch](key) {
92 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String)); 92 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String));
93 } 93 }
94 forEach(f) { 94 forEach(f) {
95 let keys = this[_keys]; 95 let keys = this[_keys];
96 for (let i = 0; i['<'](dart.dload(keys, 'length')); i = dart.notNull(i) + 1) { 96 for (let i = 0; core.int['<'](i, dart.dload(keys, 'length')); i = dart.n otNull(i) + 1) {
97 let key = dart.dindex(keys, i); 97 let key = dart.dindex(keys, i);
98 f(dart.as(key, K), dart.as(this[_fetch](key), V)); 98 f(dart.as(key, K), dart.as(this[_fetch](key), V));
99 } 99 }
100 } 100 }
101 get keys() { 101 get keys() {
102 return new (_ConstantMapKeyIterable$(K))(this); 102 return new (_ConstantMapKeyIterable$(K))(this);
103 } 103 }
104 get values() { 104 get values() {
105 return new (_internal.MappedIterable$(K, V))(this[_keys], dart.as((key = > this[_fetch](key)).bind(this), dart.functionType(V, [K]))); 105 return new (_internal.MappedIterable$(K, V))(this[_keys], dart.as((key = > this[_fetch](key)).bind(this), dart.functionType(V, [K])));
106 } 106 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 function initNativeDispatchContinue() { 370 function initNativeDispatchContinue() {
371 exports.dispatchRecordsForInstanceTags = Object.create(null); 371 exports.dispatchRecordsForInstanceTags = Object.create(null);
372 exports.interceptorsForUncacheableTags = Object.create(null); 372 exports.interceptorsForUncacheableTags = Object.create(null);
373 initHooks(); 373 initHooks();
374 let map = exports.interceptorsByTag; 374 let map = exports.interceptorsByTag;
375 let tags = Object.getOwnPropertyNames(map); 375 let tags = Object.getOwnPropertyNames(map);
376 if (typeof window != "undefined") { 376 if (typeof window != "undefined") {
377 let context = window; 377 let context = window;
378 let fun = function() { 378 let fun = function() {
379 }; 379 };
380 for (let i = 0; i['<'](dart.dload(tags, 'length')); i = dart.notNull(i) + 1) { 380 for (let i = 0; core.int['<'](i, dart.dload(tags, 'length')); i = dart.not Null(i) + 1) {
381 let tag = dart.dindex(tags, i); 381 let tag = dart.dindex(tags, i);
382 let proto = dart.dcall(exports.prototypeForTagFunction, tag); 382 let proto = dart.dcall(exports.prototypeForTagFunction, tag);
383 if (proto != null) { 383 if (proto != null) {
384 let interceptorClass = map[tag]; 384 let interceptorClass = map[tag];
385 let record = makeDefaultDispatchRecord(tag, interceptorClass, proto); 385 let record = makeDefaultDispatchRecord(tag, interceptorClass, proto);
386 if (record != null) { 386 if (record != null) {
387 _interceptors.setDispatchProperty(proto, record); 387 _interceptors.setDispatchProperty(proto, record);
388 fun.prototype = proto; 388 fun.prototype = proto;
389 } 389 }
390 } 390 }
391 } 391 }
392 } 392 }
393 for (let i = 0; i['<'](dart.dload(tags, 'length')); i = dart.notNull(i) + 1) { 393 for (let i = 0; core.int['<'](i, dart.dload(tags, 'length')); i = dart.notNu ll(i) + 1) {
394 let tag = tags[i]; 394 let tag = tags[i];
395 if (/^[A-Za-z_]/.test(tag)) { 395 if (/^[A-Za-z_]/.test(tag)) {
396 let interceptorClass = propertyGet(map, tag); 396 let interceptorClass = propertyGet(map, tag);
397 propertySet(map, core.String['+'](INSTANCE_CACHED_MARK, tag), intercepto rClass); 397 propertySet(map, dart.notNull(INSTANCE_CACHED_MARK) + dart.notNull(tag), interceptorClass);
398 propertySet(map, core.String['+'](UNCACHED_MARK, tag), interceptorClass) ; 398 propertySet(map, dart.notNull(UNCACHED_MARK) + dart.notNull(tag), interc eptorClass);
399 propertySet(map, core.String['+'](LEAF_MARK, tag), interceptorClass); 399 propertySet(map, dart.notNull(LEAF_MARK) + dart.notNull(tag), intercepto rClass);
400 propertySet(map, core.String['+'](INTERIOR_MARK, tag), interceptorClass) ; 400 propertySet(map, dart.notNull(INTERIOR_MARK) + dart.notNull(tag), interc eptorClass);
401 propertySet(map, core.String['+'](DISCRIMINATED_MARK, tag), interceptorC lass); 401 propertySet(map, dart.notNull(DISCRIMINATED_MARK) + dart.notNull(tag), i nterceptorClass);
402 } 402 }
403 } 403 }
404 } 404 }
405 // Function initHooks: () → void 405 // Function initHooks: () → void
406 function initHooks() { 406 function initHooks() {
407 let hooks = _baseHooks(); 407 let hooks = _baseHooks();
408 let _fallbackConstructorHooksTransformer = _fallbackConstructorHooksTransfor merGenerator(_constructorNameFallback); 408 let _fallbackConstructorHooksTransformer = _fallbackConstructorHooksTransfor merGenerator(_constructorNameFallback);
409 hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks); 409 hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks);
410 hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks); 410 hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks);
411 hooks = applyHooksTransformer(_ieHooksTransformer, hooks); 411 hooks = applyHooksTransformer(_ieHooksTransformer, hooks);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 toString() { 884 toString() {
885 if (this[_unmangledName] != null) 885 if (this[_unmangledName] != null)
886 return this[_unmangledName]; 886 return this[_unmangledName];
887 let unmangledName = _js_names.unmangleAllIdentifiersIfPreservedAnyways(thi s[_typeName]); 887 let unmangledName = _js_names.unmangleAllIdentifiersIfPreservedAnyways(thi s[_typeName]);
888 return this[_unmangledName] = unmangledName; 888 return this[_unmangledName] = unmangledName;
889 } 889 }
890 get hashCode() { 890 get hashCode() {
891 return this[_typeName].hashCode; 891 return this[_typeName].hashCode;
892 } 892 }
893 ['=='](other) { 893 ['=='](other) {
894 return dart.is(other, TypeImpl) && dart.notNull(dart.equals(this[_typeName ], dart.dload(other, _typeName))); 894 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload (other, _typeName));
895 } 895 }
896 } 896 }
897 TypeImpl[dart.implements] = () => [core.Type]; 897 TypeImpl[dart.implements] = () => [core.Type];
898 class TypeVariable extends core.Object { 898 class TypeVariable extends core.Object {
899 TypeVariable(owner, name, bound) { 899 TypeVariable(owner, name, bound) {
900 this.owner = owner; 900 this.owner = owner;
901 this.name = name; 901 this.name = name;
902 this.bound = bound; 902 this.bound = bound;
903 } 903 }
904 } 904 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 } 1085 }
1086 return true; 1086 return true;
1087 } 1087 }
1088 // Function computeSignature: (dynamic, dynamic, dynamic) → dynamic 1088 // Function computeSignature: (dynamic, dynamic, dynamic) → dynamic
1089 function computeSignature(signature, context, contextName) { 1089 function computeSignature(signature, context, contextName) {
1090 let typeArguments = getRuntimeTypeArguments(context, contextName); 1090 let typeArguments = getRuntimeTypeArguments(context, contextName);
1091 return invokeOn(signature, context, typeArguments); 1091 return invokeOn(signature, context, typeArguments);
1092 } 1092 }
1093 // Function isSupertypeOfNull: (dynamic) → bool 1093 // Function isSupertypeOfNull: (dynamic) → bool
1094 function isSupertypeOfNull(type) { 1094 function isSupertypeOfNull(type) {
1095 return dart.notNull(type == null) || dart.notNull(getConstructorName(type) = = _foreign_helper.JS_OBJECT_CLASS_NAME()) || dart.notNull(getConstructorName(typ e) == _foreign_helper.JS_NULL_CLASS_NAME()); 1095 return dart.notNull(type == null) || getConstructorName(type) == _foreign_he lper.JS_OBJECT_CLASS_NAME() || getConstructorName(type) == _foreign_helper.JS_NU LL_CLASS_NAME();
1096 } 1096 }
1097 // Function checkSubtypeOfRuntimeType: (dynamic, dynamic) → bool 1097 // Function checkSubtypeOfRuntimeType: (dynamic, dynamic) → bool
1098 function checkSubtypeOfRuntimeType(o, t) { 1098 function checkSubtypeOfRuntimeType(o, t) {
1099 if (o == null) 1099 if (o == null)
1100 return isSupertypeOfNull(t); 1100 return isSupertypeOfNull(t);
1101 if (t == null) 1101 if (t == null)
1102 return true; 1102 return true;
1103 let rti = getRuntimeTypeInfo(o); 1103 let rti = getRuntimeTypeInfo(o);
1104 o = _interceptors.getInterceptor(o); 1104 o = _interceptors.getInterceptor(o);
1105 let type = o.constructor; 1105 let type = o.constructor;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 // Function getMetadata: (int) → dynamic 1717 // Function getMetadata: (int) → dynamic
1718 function getMetadata(index) { 1718 function getMetadata(index) {
1719 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET ADATA); 1719 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET ADATA);
1720 return metadata[index]; 1720 return metadata[index];
1721 } 1721 }
1722 let _throwFormatException = Symbol('_throwFormatException'); 1722 let _throwFormatException = Symbol('_throwFormatException');
1723 let _fromCharCodeApply = Symbol('_fromCharCodeApply'); 1723 let _fromCharCodeApply = Symbol('_fromCharCodeApply');
1724 let _mangledNameMatchesType = Symbol('_mangledNameMatchesType'); 1724 let _mangledNameMatchesType = Symbol('_mangledNameMatchesType');
1725 class Primitives extends core.Object { 1725 class Primitives extends core.Object {
1726 static initializeStatics(id) { 1726 static initializeStatics(id) {
1727 Primitives.mirrorFunctionCacheName = core.String['+'](Primitives.mirrorFun ctionCacheName, `_${id}`); 1727 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio nCacheName) + `_${id}`;
1728 Primitives.mirrorInvokeCacheName = core.String['+'](Primitives.mirrorInvok eCacheName, `_${id}`); 1728 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac heName) + `_${id}`;
1729 } 1729 }
1730 static objectHashCode(object) { 1730 static objectHashCode(object) {
1731 let hash = dart.as(object.$identityHash, core.int); 1731 let hash = dart.as(object.$identityHash, core.int);
1732 if (hash == null) { 1732 if (hash == null) {
1733 hash = Math.random() * 0x3fffffff | 0; 1733 hash = Math.random() * 0x3fffffff | 0;
1734 object.$identityHash = hash; 1734 object.$identityHash = hash;
1735 } 1735 }
1736 return hash; 1736 return hash;
1737 } 1737 }
1738 static [_throwFormatException](string) { 1738 static [_throwFormatException](string) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 static parseDouble(source, handleError) { 1792 static parseDouble(source, handleError) {
1793 checkString(source); 1793 checkString(source);
1794 if (handleError == null) 1794 if (handleError == null)
1795 handleError = dart.as(Primitives[_throwFormatException], dart.functionTy pe(core.double, [core.String])); 1795 handleError = dart.as(Primitives[_throwFormatException], dart.functionTy pe(core.double, [core.String]));
1796 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s *$/.test(source)) { 1796 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s *$/.test(source)) {
1797 return handleError(source); 1797 return handleError(source);
1798 } 1798 }
1799 let result = parseFloat(source); 1799 let result = parseFloat(source);
1800 if (result.isNaN) { 1800 if (result.isNaN) {
1801 let trimmed = source.trim(); 1801 let trimmed = source.trim();
1802 if (dart.notNull(trimmed == 'NaN') || dart.notNull(trimmed == '+NaN') || dart.notNull(trimmed == '-NaN')) { 1802 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') {
1803 return result; 1803 return result;
1804 } 1804 }
1805 return handleError(source); 1805 return handleError(source);
1806 } 1806 }
1807 return result; 1807 return result;
1808 } 1808 }
1809 static formatType(className, typeArguments) { 1809 static formatType(className, typeArguments) {
1810 return _js_names.unmangleAllIdentifiersIfPreservedAnyways(`${className}${j oinArguments(typeArguments, 0)}`); 1810 return _js_names.unmangleAllIdentifiersIfPreservedAnyways(`${className}${j oinArguments(typeArguments, 0)}`);
1811 } 1811 }
1812 static objectTypeName(object) { 1812 static objectTypeName(object) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 return result; 1876 return result;
1877 } 1877 }
1878 static stringFromCodePoints(codePoints) { 1878 static stringFromCodePoints(codePoints) {
1879 let a = new core.List$(core.int).from([]); 1879 let a = new core.List$(core.int).from([]);
1880 for (let i of dart.as(codePoints, core.Iterable)) { 1880 for (let i of dart.as(codePoints, core.Iterable)) {
1881 if (!(typeof i == 'number')) 1881 if (!(typeof i == 'number'))
1882 throw new core.ArgumentError(i); 1882 throw new core.ArgumentError(i);
1883 if (dart.dsend(i, '<=', 65535)) { 1883 if (dart.dsend(i, '<=', 65535)) {
1884 a[core.$add](dart.as(i, core.int)); 1884 a[core.$add](dart.as(i, core.int));
1885 } else if (dart.dsend(i, '<=', 1114111)) { 1885 } else if (dart.dsend(i, '<=', 1114111)) {
1886 a[core.$add](55296['+'](dart.dsend(dart.dsend(dart.dsend(i, '-', 65536 ), '>>', 10), '&', 1023))); 1886 a[core.$add](core.int['+'](55296, dart.dsend(dart.dsend(dart.dsend(i, '-', 65536), '>>', 10), '&', 1023)));
1887 a[core.$add](56320['+'](dart.dsend(i, '&', 1023))); 1887 a[core.$add](core.int['+'](56320, dart.dsend(i, '&', 1023)));
1888 } else { 1888 } else {
1889 throw new core.ArgumentError(i); 1889 throw new core.ArgumentError(i);
1890 } 1890 }
1891 } 1891 }
1892 return Primitives[_fromCharCodeApply](a); 1892 return Primitives[_fromCharCodeApply](a);
1893 } 1893 }
1894 static stringFromCharCodes(charCodes) { 1894 static stringFromCharCodes(charCodes) {
1895 for (let i of dart.as(charCodes, core.Iterable)) { 1895 for (let i of dart.as(charCodes, core.Iterable)) {
1896 if (!(typeof i == 'number')) 1896 if (!(typeof i == 'number'))
1897 throw new core.ArgumentError(i); 1897 throw new core.ArgumentError(i);
1898 if (dart.dsend(i, '<', 0)) 1898 if (dart.dsend(i, '<', 0))
1899 throw new core.ArgumentError(i); 1899 throw new core.ArgumentError(i);
1900 if (dart.dsend(i, '>', 65535)) 1900 if (dart.dsend(i, '>', 65535))
1901 return Primitives.stringFromCodePoints(charCodes); 1901 return Primitives.stringFromCodePoints(charCodes);
1902 } 1902 }
1903 return Primitives[_fromCharCodeApply](dart.as(charCodes, core.List$(core.i nt))); 1903 return Primitives[_fromCharCodeApply](dart.as(charCodes, core.List$(core.i nt)));
1904 } 1904 }
1905 static stringFromCharCode(charCode) { 1905 static stringFromCharCode(charCode) {
1906 if (0['<='](charCode)) { 1906 if (core.int['<='](0, charCode)) {
1907 if (dart.dsend(charCode, '<=', 65535)) { 1907 if (dart.dsend(charCode, '<=', 65535)) {
1908 return String.fromCharCode(charCode); 1908 return String.fromCharCode(charCode);
1909 } 1909 }
1910 if (dart.dsend(charCode, '<=', 1114111)) { 1910 if (dart.dsend(charCode, '<=', 1114111)) {
1911 let bits = dart.dsend(charCode, '-', 65536); 1911 let bits = dart.dsend(charCode, '-', 65536);
1912 let low = 56320['|'](dart.dsend(bits, '&', 1023)); 1912 let low = core.int['|'](56320, dart.dsend(bits, '&', 1023));
1913 let high = 55296['|'](dart.dsend(bits, '>>', 10)); 1913 let high = core.int['|'](55296, dart.dsend(bits, '>>', 10));
1914 return String.fromCharCode(high, low); 1914 return String.fromCharCode(high, low);
1915 } 1915 }
1916 } 1916 }
1917 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111); 1917 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111);
1918 } 1918 }
1919 static stringConcatUnchecked(string1, string2) { 1919 static stringConcatUnchecked(string1, string2) {
1920 return _foreign_helper.JS_STRING_CONCAT(string1, string2); 1920 return _foreign_helper.JS_STRING_CONCAT(string1, string2);
1921 } 1921 }
1922 static flattenString(str) { 1922 static flattenString(str) {
1923 return str.charCodeAt(0) == 0 ? str : str; 1923 return str.charCodeAt(0) == 0 ? str : str;
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3375 let rti = dart.dsend(this.namedParameters[name], 'toRti'); 3375 let rti = dart.dsend(this.namedParameters[name], 'toRti');
3376 namedRti[name] = rti; 3376 namedRti[name] = rti;
3377 } 3377 }
3378 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR ti; 3378 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR ti;
3379 } 3379 }
3380 return result; 3380 return result;
3381 } 3381 }
3382 static listToRti(list) { 3382 static listToRti(list) {
3383 list = list; 3383 list = list;
3384 let result = []; 3384 let result = [];
3385 for (let i = 0; i['<'](dart.dload(list, 'length')); i = dart.notNull(i) + 1) { 3385 for (let i = 0; core.int['<'](i, dart.dload(list, 'length')); i = dart.not Null(i) + 1) {
3386 result.push(dart.dsend(dart.dindex(list, i), 'toRti')); 3386 result.push(dart.dsend(dart.dindex(list, i), 'toRti'));
3387 } 3387 }
3388 return result; 3388 return result;
3389 } 3389 }
3390 toString() { 3390 toString() {
3391 let result = '('; 3391 let result = '(';
3392 let needsComma = false; 3392 let needsComma = false;
3393 if (this.parameterTypes != null) { 3393 if (this.parameterTypes != null) {
3394 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes[core. $length]); i = dart.notNull(i) + 1) { 3394 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes[core. $length]); i = dart.notNull(i) + 1) {
3395 let type = this.parameterTypes[core.$get](i); 3395 let type = this.parameterTypes[core.$get](i);
3396 if (needsComma) { 3396 if (needsComma) {
3397 result = core.String['+'](result, ', '); 3397 result = dart.notNull(result) + ', ';
3398 } 3398 }
3399 result = core.String['+'](result, `${type}`); 3399 result = dart.notNull(result) + `${type}`;
3400 needsComma = true; 3400 needsComma = true;
3401 } 3401 }
3402 } 3402 }
3403 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi s.optionalParameterTypes[core.$isEmpty])) { 3403 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi s.optionalParameterTypes[core.$isEmpty])) {
3404 if (needsComma) { 3404 if (needsComma) {
3405 result = core.String['+'](result, ', '); 3405 result = dart.notNull(result) + ', ';
3406 } 3406 }
3407 needsComma = false; 3407 needsComma = false;
3408 result = core.String['+'](result, '['); 3408 result = dart.notNull(result) + '[';
3409 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp es[core.$length]); i = dart.notNull(i) + 1) { 3409 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp es[core.$length]); i = dart.notNull(i) + 1) {
3410 let type = this.optionalParameterTypes[core.$get](i); 3410 let type = this.optionalParameterTypes[core.$get](i);
3411 if (needsComma) { 3411 if (needsComma) {
3412 result = core.String['+'](result, ', '); 3412 result = dart.notNull(result) + ', ';
3413 } 3413 }
3414 result = core.String['+'](result, `${type}`); 3414 result = dart.notNull(result) + `${type}`;
3415 needsComma = true; 3415 needsComma = true;
3416 } 3416 }
3417 result = core.String['+'](result, ']'); 3417 result = dart.notNull(result) + ']';
3418 } else if (this.namedParameters != null) { 3418 } else if (this.namedParameters != null) {
3419 if (needsComma) { 3419 if (needsComma) {
3420 result = core.String['+'](result, ', '); 3420 result = dart.notNull(result) + ', ';
3421 } 3421 }
3422 needsComma = false; 3422 needsComma = false;
3423 result = core.String['+'](result, '{'); 3423 result = dart.notNull(result) + '{';
3424 let keys = _js_names.extractKeys(this.namedParameters); 3424 let keys = _js_names.extractKeys(this.namedParameters);
3425 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i = dart.notNull(i) + 1) { 3425 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i = dart.notNull(i) + 1) {
3426 let name = keys[core.$get](i); 3426 let name = keys[core.$get](i);
3427 if (needsComma) { 3427 if (needsComma) {
3428 result = core.String['+'](result, ', '); 3428 result = dart.notNull(result) + ', ';
3429 } 3429 }
3430 let rti = dart.dsend(this.namedParameters[name], 'toRti'); 3430 let rti = dart.dsend(this.namedParameters[name], 'toRti');
3431 result = core.String['+'](result, `${rti} ${name}`); 3431 result = dart.notNull(result) + `${rti} ${name}`;
3432 needsComma = true; 3432 needsComma = true;
3433 } 3433 }
3434 result = core.String['+'](result, '}'); 3434 result = dart.notNull(result) + '}';
3435 } 3435 }
3436 result = core.String['+'](result, `) -> ${this.returnType}`); 3436 result = dart.notNull(result) + `) -> ${this.returnType}`;
3437 return result; 3437 return result;
3438 } 3438 }
3439 } 3439 }
3440 RuntimeFunctionType.inAssert = false; 3440 RuntimeFunctionType.inAssert = false;
3441 // Function buildFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunctionTy pe 3441 // Function buildFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunctionTy pe
3442 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) { 3442 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) {
3443 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null); 3443 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null);
3444 } 3444 }
3445 // Function buildNamedFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunct ionType 3445 // Function buildNamedFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunct ionType
3446 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) { 3446 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 throw 'bad type'; 3618 throw 'bad type';
3619 } 3619 }
3620 } 3620 }
3621 toString() { 3621 toString() {
3622 if (this[_cachedToString] != null) 3622 if (this[_cachedToString] != null)
3623 return this[_cachedToString]; 3623 return this[_cachedToString];
3624 let s = "("; 3624 let s = "(";
3625 let sep = ''; 3625 let sep = '';
3626 if (this[_hasArguments]) { 3626 if (this[_hasArguments]) {
3627 for (let argument of this[_arguments]) { 3627 for (let argument of this[_arguments]) {
3628 s = core.String['+'](s, sep); 3628 s = dart.notNull(s) + dart.notNull(sep);
3629 s = core.String['+'](s, this[_convert](argument)); 3629 s = dart.notNull(s) + dart.notNull(this[_convert](argument));
3630 sep = ', '; 3630 sep = ', ';
3631 } 3631 }
3632 } 3632 }
3633 if (this[_hasOptionalArguments]) { 3633 if (this[_hasOptionalArguments]) {
3634 s = core.String['+'](s, `${sep}[`); 3634 s = dart.notNull(s) + `${sep}[`;
3635 sep = ''; 3635 sep = '';
3636 for (let argument of this[_optionalArguments]) { 3636 for (let argument of this[_optionalArguments]) {
3637 s = core.String['+'](s, sep); 3637 s = dart.notNull(s) + dart.notNull(sep);
3638 s = core.String['+'](s, this[_convert](argument)); 3638 s = dart.notNull(s) + dart.notNull(this[_convert](argument));
3639 sep = ', '; 3639 sep = ', ';
3640 } 3640 }
3641 s = core.String['+'](s, ']'); 3641 s = dart.notNull(s) + ']';
3642 } 3642 }
3643 if (this[_hasNamedArguments]) { 3643 if (this[_hasNamedArguments]) {
3644 s = core.String['+'](s, `${sep}{`); 3644 s = dart.notNull(s) + `${sep}{`;
3645 sep = ''; 3645 sep = '';
3646 for (let name of _js_names.extractKeys(this[_namedArguments])) { 3646 for (let name of _js_names.extractKeys(this[_namedArguments])) {
3647 s = core.String['+'](s, sep); 3647 s = dart.notNull(s) + dart.notNull(sep);
3648 s = core.String['+'](s, `${name}: `); 3648 s = dart.notNull(s) + `${name}: `;
3649 s = core.String['+'](s, this[_convert](this[_namedArguments][name])); 3649 s = dart.notNull(s) + dart.notNull(this[_convert](this[_namedArguments ][name]));
3650 sep = ', '; 3650 sep = ', ';
3651 } 3651 }
3652 s = core.String['+'](s, '}'); 3652 s = dart.notNull(s) + '}';
3653 } 3653 }
3654 s = core.String['+'](s, ') -> '); 3654 s = dart.notNull(s) + ') -> ';
3655 if (this[_isVoid]) { 3655 if (this[_isVoid]) {
3656 s = core.String['+'](s, 'void'); 3656 s = dart.notNull(s) + 'void';
3657 } else if (this[_hasReturnType]) { 3657 } else if (this[_hasReturnType]) {
3658 s = core.String['+'](s, this[_convert](this[_returnType])); 3658 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType]));
3659 } else { 3659 } else {
3660 s = core.String['+'](s, 'dynamic'); 3660 s = dart.notNull(s) + 'dynamic';
3661 } 3661 }
3662 return this[_cachedToString] = `${s}`; 3662 return this[_cachedToString] = `${s}`;
3663 } 3663 }
3664 } 3664 }
3665 class UnimplementedNoSuchMethodError extends core.Error { 3665 class UnimplementedNoSuchMethodError extends core.Error {
3666 UnimplementedNoSuchMethodError(message$) { 3666 UnimplementedNoSuchMethodError(message$) {
3667 this[_message] = message$; 3667 this[_message] = message$;
3668 super.Error(); 3668 super.Error();
3669 } 3669 }
3670 toString() { 3670 toString() {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
4043 exports.jsonEncodeNative = jsonEncodeNative; 4043 exports.jsonEncodeNative = jsonEncodeNative;
4044 exports.getIsolateAffinityTag = getIsolateAffinityTag; 4044 exports.getIsolateAffinityTag = getIsolateAffinityTag;
4045 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; 4045 exports.LoadLibraryFunctionType = LoadLibraryFunctionType;
4046 exports.DeferredLoadCallback = DeferredLoadCallback; 4046 exports.DeferredLoadCallback = DeferredLoadCallback;
4047 exports.loadDeferredLibrary = loadDeferredLibrary; 4047 exports.loadDeferredLibrary = loadDeferredLibrary;
4048 exports.MainError = MainError; 4048 exports.MainError = MainError;
4049 exports.missingMain = missingMain; 4049 exports.missingMain = missingMain;
4050 exports.badMain = badMain; 4050 exports.badMain = badMain;
4051 exports.mainHasTooManyParameters = mainHasTooManyParameters; 4051 exports.mainHasTooManyParameters = mainHasTooManyParameters;
4052 })(_js_helper || (_js_helper = {})); 4052 })(_js_helper || (_js_helper = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698