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

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

Issue 1093143004: 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/_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 dart.initField(IrRepresentation, 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 dart.initField(Native, this, 'name', name);
24 } 24 }
25 } 25 }
26 let _ = Symbol('_'); 26 let _ = Symbol('_');
27 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); 27 let _throwUnmodifiable = Symbol('_throwUnmodifiable');
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 [_]() { 30 [_]() {
31 } 31 }
32 get isEmpty() { 32 get isEmpty() {
33 return this.length == 0; 33 return this.length == 0;
(...skipping 27 matching lines...) Expand all
61 dart.defineNamedConstructor(ConstantMap, _); 61 dart.defineNamedConstructor(ConstantMap, _);
62 return ConstantMap; 62 return ConstantMap;
63 }); 63 });
64 let ConstantMap = ConstantMap$(); 64 let ConstantMap = ConstantMap$();
65 let _jsObject = Symbol('_jsObject'); 65 let _jsObject = Symbol('_jsObject');
66 let _keys = Symbol('_keys'); 66 let _keys = Symbol('_keys');
67 let _fetch = Symbol('_fetch'); 67 let _fetch = Symbol('_fetch');
68 let ConstantStringMap$ = dart.generic(function(K, V) { 68 let ConstantStringMap$ = dart.generic(function(K, V) {
69 class ConstantStringMap extends ConstantMap$(K, V) { 69 class ConstantStringMap extends ConstantMap$(K, V) {
70 [_](length, jsObject, keys) { 70 [_](length, jsObject, keys) {
71 this.length = length; 71 dart.initField(ConstantStringMap, this, 'length', length);
72 this[_jsObject] = jsObject; 72 this[_jsObject] = jsObject;
73 this[_keys] = keys; 73 this[_keys] = keys;
74 super[_](); 74 super[_]();
75 } 75 }
76 containsValue(needle) { 76 containsValue(needle) {
77 return this.values[core.$any](value => dart.equals(value, needle)); 77 return this.values[core.$any](value => dart.equals(value, needle));
78 } 78 }
79 containsKey(key) { 79 containsKey(key) {
80 if (!(typeof key == 'string')) 80 if (!(typeof key == 'string'))
81 return false; 81 return false;
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 let _isCaseSensitive = Symbol('_isCaseSensitive'); 473 let _isCaseSensitive = Symbol('_isCaseSensitive');
474 let _execGlobal = Symbol('_execGlobal'); 474 let _execGlobal = Symbol('_execGlobal');
475 let _execAnchored = Symbol('_execAnchored'); 475 let _execAnchored = Symbol('_execAnchored');
476 class JSSyntaxRegExp extends core.Object { 476 class JSSyntaxRegExp extends core.Object {
477 toString() { 477 toString() {
478 return `RegExp/${this.pattern}/`; 478 return `RegExp/${this.pattern}/`;
479 } 479 }
480 JSSyntaxRegExp(source, opts) { 480 JSSyntaxRegExp(source, opts) {
481 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false; 481 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
482 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true; 482 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true;
483 this.pattern = source; 483 dart.initField(JSSyntaxRegExp, this, 'pattern', source);
484 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen sitive, false); 484 dart.initField(JSSyntaxRegExp, this, _nativeRegExp, JSSyntaxRegExp.makeNat ive(source, multiLine, caseSensitive, false));
485 this[_nativeGlobalRegExp] = null; 485 dart.initField(JSSyntaxRegExp, this, _nativeGlobalRegExp, null);
486 this[_nativeAnchoredRegExp] = null; 486 dart.initField(JSSyntaxRegExp, this, _nativeAnchoredRegExp, null);
487 } 487 }
488 get [_nativeGlobalVersion]() { 488 get [_nativeGlobalVersion]() {
489 if (this[_nativeGlobalRegExp] != null) 489 if (this[_nativeGlobalRegExp] != null)
490 return this[_nativeGlobalRegExp]; 490 return this[_nativeGlobalRegExp];
491 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern, this[_isMultiLine], this[_isCaseSensitive], true); 491 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern, this[_isMultiLine], this[_isCaseSensitive], true);
492 } 492 }
493 get [_nativeAnchoredVersion]() { 493 get [_nativeAnchoredVersion]() {
494 if (this[_nativeAnchoredRegExp] != null) 494 if (this[_nativeAnchoredRegExp] != null)
495 return this[_nativeAnchoredRegExp]; 495 return this[_nativeAnchoredRegExp];
496 return this[_nativeAnchoredRegExp] = JSSyntaxRegExp.makeNative(`${this.pat tern}|()`, this[_isMultiLine], this[_isCaseSensitive], true); 496 return this[_nativeAnchoredRegExp] = JSSyntaxRegExp.makeNative(`${this.pat tern}|()`, this[_isMultiLine], this[_isCaseSensitive], true);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 return false; 661 return false;
662 } 662 }
663 } 663 }
664 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)]; 664 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)];
665 // Function firstMatchAfter: (JSSyntaxRegExp, String, int) → Match 665 // Function firstMatchAfter: (JSSyntaxRegExp, String, int) → Match
666 function firstMatchAfter(regExp, string, start) { 666 function firstMatchAfter(regExp, string, start) {
667 return regExp[_execGlobal](string, start); 667 return regExp[_execGlobal](string, start);
668 } 668 }
669 class StringMatch extends core.Object { 669 class StringMatch extends core.Object {
670 StringMatch(start, input, pattern) { 670 StringMatch(start, input, pattern) {
671 this.start = start; 671 dart.initField(StringMatch, this, 'start', start);
672 this.input = input; 672 dart.initField(StringMatch, this, 'input', input);
673 this.pattern = pattern; 673 dart.initField(StringMatch, this, 'pattern', pattern);
674 } 674 }
675 get end() { 675 get end() {
676 return dart.notNull(this.start) + dart.notNull(this.pattern.length); 676 return dart.notNull(this.start) + dart.notNull(this.pattern.length);
677 } 677 }
678 get(g) { 678 get(g) {
679 return this.group(g); 679 return this.group(g);
680 } 680 }
681 get groupCount() { 681 get groupCount() {
682 return 0; 682 return 0;
683 } 683 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 return array.join(separator); 871 return array.join(separator);
872 } 872 }
873 // Function createRuntimeType: (String) → Type 873 // Function createRuntimeType: (String) → Type
874 function createRuntimeType(name) { 874 function createRuntimeType(name) {
875 return new TypeImpl(name); 875 return new TypeImpl(name);
876 } 876 }
877 let _typeName = Symbol('_typeName'); 877 let _typeName = Symbol('_typeName');
878 let _unmangledName = Symbol('_unmangledName'); 878 let _unmangledName = Symbol('_unmangledName');
879 class TypeImpl extends core.Object { 879 class TypeImpl extends core.Object {
880 TypeImpl(typeName) { 880 TypeImpl(typeName) {
881 this[_typeName] = typeName; 881 dart.initField(TypeImpl, this, _typeName, typeName);
882 this[_unmangledName] = null; 882 dart.initField(TypeImpl, this, _unmangledName, null);
883 } 883 }
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.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 dart.initField(TypeVariable, this, 'owner', owner);
901 this.name = name; 901 dart.initField(TypeVariable, this, 'name', name);
902 this.bound = bound; 902 dart.initField(TypeVariable, this, 'bound', bound);
903 } 903 }
904 } 904 }
905 // Function getMangledTypeName: (TypeImpl) → dynamic 905 // Function getMangledTypeName: (TypeImpl) → dynamic
906 function getMangledTypeName(type) { 906 function getMangledTypeName(type) {
907 return type[_typeName]; 907 return type[_typeName];
908 } 908 }
909 // Function setRuntimeTypeInfo: (Object, dynamic) → Object 909 // Function setRuntimeTypeInfo: (Object, dynamic) → Object
910 function setRuntimeTypeInfo(target, typeInfo) { 910 function setRuntimeTypeInfo(target, typeInfo) {
911 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf o))); 911 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf o)));
912 if (target != null) 912 if (target != null)
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 } 1396 }
1397 let _memberName = Symbol('_memberName'); 1397 let _memberName = Symbol('_memberName');
1398 let _internalName = Symbol('_internalName'); 1398 let _internalName = Symbol('_internalName');
1399 let _kind = Symbol('_kind'); 1399 let _kind = Symbol('_kind');
1400 let _arguments = Symbol('_arguments'); 1400 let _arguments = Symbol('_arguments');
1401 let _namedArgumentNames = Symbol('_namedArgumentNames'); 1401 let _namedArgumentNames = Symbol('_namedArgumentNames');
1402 let _namedIndices = Symbol('_namedIndices'); 1402 let _namedIndices = Symbol('_namedIndices');
1403 let _getCachedInvocation = Symbol('_getCachedInvocation'); 1403 let _getCachedInvocation = Symbol('_getCachedInvocation');
1404 class JSInvocationMirror extends core.Object { 1404 class JSInvocationMirror extends core.Object {
1405 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument Names) { 1405 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument Names) {
1406 this[_memberName] = memberName; 1406 dart.initField(JSInvocationMirror, this, _memberName, memberName);
1407 this[_internalName] = internalName; 1407 dart.initField(JSInvocationMirror, this, _internalName, internalName);
1408 this[_kind] = kind; 1408 dart.initField(JSInvocationMirror, this, _kind, kind);
1409 this[_arguments] = arguments$; 1409 dart.initField(JSInvocationMirror, this, _arguments, arguments$);
1410 this[_namedArgumentNames] = namedArgumentNames; 1410 dart.initField(JSInvocationMirror, this, _namedArgumentNames, namedArgumen tNames);
1411 this[_namedIndices] = null; 1411 dart.initField(JSInvocationMirror, this, _namedIndices, null);
1412 } 1412 }
1413 get memberName() { 1413 get memberName() {
1414 if (dart.is(this[_memberName], core.Symbol)) 1414 if (dart.is(this[_memberName], core.Symbol))
1415 return dart.as(this[_memberName], core.Symbol); 1415 return dart.as(this[_memberName], core.Symbol);
1416 let name = dart.as(this[_memberName], core.String); 1416 let name = dart.as(this[_memberName], core.String);
1417 let unmangledName = _js_names.mangledNames.get(name); 1417 let unmangledName = _js_names.mangledNames.get(name);
1418 if (unmangledName != null) { 1418 if (unmangledName != null) {
1419 name = unmangledName.split(':')[core.$get](0); 1419 name = unmangledName.split(':')[core.$get](0);
1420 } else { 1420 } else {
1421 if (_js_names.mangledNames.get(this[_internalName]) == null) { 1421 if (_js_names.mangledNames.get(this[_internalName]) == null) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 static getCachedInvocation(invocation, victim) { 1515 static getCachedInvocation(invocation, victim) {
1516 return invocation[_getCachedInvocation](victim); 1516 return invocation[_getCachedInvocation](victim);
1517 } 1517 }
1518 } 1518 }
1519 JSInvocationMirror[dart.implements] = () => [core.Invocation]; 1519 JSInvocationMirror[dart.implements] = () => [core.Invocation];
1520 JSInvocationMirror.METHOD = 0; 1520 JSInvocationMirror.METHOD = 0;
1521 JSInvocationMirror.GETTER = 1; 1521 JSInvocationMirror.GETTER = 1;
1522 JSInvocationMirror.SETTER = 2; 1522 JSInvocationMirror.SETTER = 2;
1523 class CachedInvocation extends core.Object { 1523 class CachedInvocation extends core.Object {
1524 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor) { 1524 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor) {
1525 this.mangledName = mangledName; 1525 dart.initField(CachedInvocation, this, 'mangledName', mangledName);
1526 this.jsFunction = jsFunction; 1526 dart.initField(CachedInvocation, this, 'jsFunction', jsFunction);
1527 this.isIntercepted = isIntercepted; 1527 dart.initField(CachedInvocation, this, 'isIntercepted', isIntercepted);
1528 this.cachedInterceptor = cachedInterceptor; 1528 dart.initField(CachedInvocation, this, 'cachedInterceptor', cachedIntercep tor);
1529 } 1529 }
1530 get isNoSuchMethod() { 1530 get isNoSuchMethod() {
1531 return false; 1531 return false;
1532 } 1532 }
1533 get isGetterStub() { 1533 get isGetterStub() {
1534 return !!this.jsFunction.$getterStub; 1534 return !!this.jsFunction.$getterStub;
1535 } 1535 }
1536 invokeOn(victim, arguments$) { 1536 invokeOn(victim, arguments$) {
1537 let receiver = victim; 1537 let receiver = victim;
1538 if (!dart.notNull(this.isIntercepted)) { 1538 if (!dart.notNull(this.isIntercepted)) {
1539 if (!dart.is(arguments$, _interceptors.JSArray)) 1539 if (!dart.is(arguments$, _interceptors.JSArray))
1540 arguments$ = new core.List.from(arguments$); 1540 arguments$ = new core.List.from(arguments$);
1541 } else { 1541 } else {
1542 let _ = new core.List.from([victim]); 1542 let _ = new core.List.from([victim]);
1543 _[core.$addAll](arguments$); 1543 _[core.$addAll](arguments$);
1544 arguments$ = _; 1544 arguments$ = _;
1545 if (this.cachedInterceptor != null) 1545 if (this.cachedInterceptor != null)
1546 receiver = this.cachedInterceptor; 1546 receiver = this.cachedInterceptor;
1547 } 1547 }
1548 return this.jsFunction.apply(receiver, arguments$); 1548 return this.jsFunction.apply(receiver, arguments$);
1549 } 1549 }
1550 } 1550 }
1551 class CachedCatchAllInvocation extends CachedInvocation { 1551 class CachedCatchAllInvocation extends CachedInvocation {
1552 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor) { 1552 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor) {
1553 this.info = new ReflectionInfo(jsFunction); 1553 dart.initField(CachedCatchAllInvocation, this, 'info', new ReflectionInfo( jsFunction));
1554 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor) ; 1554 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor) ;
1555 } 1555 }
1556 get isGetterStub() { 1556 get isGetterStub() {
1557 return false; 1557 return false;
1558 } 1558 }
1559 invokeOn(victim, arguments$) { 1559 invokeOn(victim, arguments$) {
1560 let receiver = victim; 1560 let receiver = victim;
1561 let providedArgumentCount = null; 1561 let providedArgumentCount = null;
1562 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) + dart.notNull(this.info.optionalParameterCount); 1562 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) + dart.notNull(this.info.optionalParameterCount);
1563 if (!dart.notNull(this.isIntercepted)) { 1563 if (!dart.notNull(this.isIntercepted)) {
(...skipping 22 matching lines...) Expand all
1586 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`); 1586 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`);
1587 } 1587 }
1588 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) { 1588 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) {
1589 arguments$[core.$add](getMetadata(this.info.defaultValue(i))); 1589 arguments$[core.$add](getMetadata(this.info.defaultValue(i)));
1590 } 1590 }
1591 return this.jsFunction.apply(receiver, arguments$); 1591 return this.jsFunction.apply(receiver, arguments$);
1592 } 1592 }
1593 } 1593 }
1594 class CachedNoSuchMethodInvocation extends core.Object { 1594 class CachedNoSuchMethodInvocation extends core.Object {
1595 CachedNoSuchMethodInvocation(interceptor) { 1595 CachedNoSuchMethodInvocation(interceptor) {
1596 this.interceptor = interceptor; 1596 dart.initField(CachedNoSuchMethodInvocation, this, 'interceptor', intercep tor);
1597 } 1597 }
1598 get isNoSuchMethod() { 1598 get isNoSuchMethod() {
1599 return true; 1599 return true;
1600 } 1600 }
1601 get isGetterStub() { 1601 get isGetterStub() {
1602 return false; 1602 return false;
1603 } 1603 }
1604 invokeOn(victim, invocation) { 1604 invokeOn(victim, invocation) {
1605 let receiver = this.interceptor == null ? victim : this.interceptor; 1605 let receiver = this.interceptor == null ? victim : this.interceptor;
1606 return dart.dsend(receiver, 'noSuchMethod', invocation); 1606 return dart.dsend(receiver, 'noSuchMethod', invocation);
1607 } 1607 }
1608 } 1608 }
1609 class ReflectionInfo extends core.Object { 1609 class ReflectionInfo extends core.Object {
1610 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam eterCount, areOptionalParametersNamed, functionType) { 1610 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam eterCount, areOptionalParametersNamed, functionType) {
1611 this.jsFunction = jsFunction; 1611 dart.initField(ReflectionInfo, this, 'jsFunction', jsFunction);
1612 this.data = data; 1612 dart.initField(ReflectionInfo, this, 'data', data);
1613 this.isAccessor = isAccessor; 1613 dart.initField(ReflectionInfo, this, 'isAccessor', isAccessor);
1614 this.requiredParameterCount = requiredParameterCount; 1614 dart.initField(ReflectionInfo, this, 'requiredParameterCount', requiredPar ameterCount);
1615 this.optionalParameterCount = optionalParameterCount; 1615 dart.initField(ReflectionInfo, this, 'optionalParameterCount', optionalPar ameterCount);
1616 this.areOptionalParametersNamed = areOptionalParametersNamed; 1616 dart.initField(ReflectionInfo, this, 'areOptionalParametersNamed', areOpti onalParametersNamed);
1617 this.functionType = functionType; 1617 dart.initField(ReflectionInfo, this, 'functionType', functionType);
1618 this.cachedSortedIndices = null; 1618 dart.initField(ReflectionInfo, this, 'cachedSortedIndices', null);
1619 } 1619 }
1620 ReflectionInfo(jsFunction) { 1620 ReflectionInfo(jsFunction) {
1621 let data = dart.as(jsFunction.$reflectionInfo, core.List); 1621 let data = dart.as(jsFunction.$reflectionInfo, core.List);
1622 if (data == null) 1622 if (data == null)
1623 return null; 1623 return null;
1624 data = _interceptors.JSArray.markFixedList(data); 1624 data = _interceptors.JSArray.markFixedList(data);
1625 let requiredParametersInfo = data[ReflectionInfo.REQUIRED_PARAMETERS_INFO] ; 1625 let requiredParametersInfo = data[ReflectionInfo.REQUIRED_PARAMETERS_INFO] ;
1626 let requiredParameterCount = requiredParametersInfo >> 1; 1626 let requiredParameterCount = requiredParametersInfo >> 1;
1627 let isAccessor = (dart.notNull(requiredParametersInfo) & 1) == 1; 1627 let isAccessor = (dart.notNull(requiredParametersInfo) & 1) == 1;
1628 let optionalParametersInfo = data[ReflectionInfo.OPTIONAL_PARAMETERS_INFO] ; 1628 let optionalParametersInfo = data[ReflectionInfo.OPTIONAL_PARAMETERS_INFO] ;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 function throwAbstractClassInstantiationError(className) { 2223 function throwAbstractClassInstantiationError(className) {
2224 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin g)); 2224 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin g));
2225 } 2225 }
2226 let _argumentsExpr = Symbol('_argumentsExpr'); 2226 let _argumentsExpr = Symbol('_argumentsExpr');
2227 let _expr = Symbol('_expr'); 2227 let _expr = Symbol('_expr');
2228 let _method = Symbol('_method'); 2228 let _method = Symbol('_method');
2229 let _receiver = Symbol('_receiver'); 2229 let _receiver = Symbol('_receiver');
2230 let _pattern = Symbol('_pattern'); 2230 let _pattern = Symbol('_pattern');
2231 class TypeErrorDecoder extends core.Object { 2231 class TypeErrorDecoder extends core.Object {
2232 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern) { 2232 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern) {
2233 this[_arguments] = arguments$; 2233 dart.initField(TypeErrorDecoder, this, _arguments, arguments$);
2234 this[_argumentsExpr] = argumentsExpr; 2234 dart.initField(TypeErrorDecoder, this, _argumentsExpr, argumentsExpr);
2235 this[_expr] = expr; 2235 dart.initField(TypeErrorDecoder, this, _expr, expr);
2236 this[_method] = method; 2236 dart.initField(TypeErrorDecoder, this, _method, method);
2237 this[_receiver] = receiver; 2237 dart.initField(TypeErrorDecoder, this, _receiver, receiver);
2238 this[_pattern] = pattern; 2238 dart.initField(TypeErrorDecoder, this, _pattern, pattern);
2239 } 2239 }
2240 matchTypeError(message) { 2240 matchTypeError(message) {
2241 let match = new RegExp(this[_pattern]).exec(message); 2241 let match = new RegExp(this[_pattern]).exec(message);
2242 if (match == null) 2242 if (match == null)
2243 return null; 2243 return null;
2244 let result = Object.create(null); 2244 let result = Object.create(null);
2245 if (this[_arguments] != -1) { 2245 if (this[_arguments] != -1) {
2246 result.arguments = match[this[_arguments] + 1]; 2246 result.arguments = match[this[_arguments] + 1];
2247 } 2247 }
2248 if (this[_argumentsExpr] != -1) { 2248 if (this[_argumentsExpr] != -1) {
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 // Function jsPropertyAccess: (dynamic, String) → dynamic 2930 // Function jsPropertyAccess: (dynamic, String) → dynamic
2931 function jsPropertyAccess(jsObject, property) { 2931 function jsPropertyAccess(jsObject, property) {
2932 return jsObject[property]; 2932 return jsObject[property];
2933 } 2933 }
2934 // Function getFallThroughError: () → dynamic 2934 // Function getFallThroughError: () → dynamic
2935 function getFallThroughError() { 2935 function getFallThroughError() {
2936 return new FallThroughErrorImplementation(); 2936 return new FallThroughErrorImplementation();
2937 } 2937 }
2938 class Creates extends core.Object { 2938 class Creates extends core.Object {
2939 Creates(types) { 2939 Creates(types) {
2940 this.types = types; 2940 dart.initField(Creates, this, 'types', types);
2941 } 2941 }
2942 } 2942 }
2943 class Returns extends core.Object { 2943 class Returns extends core.Object {
2944 Returns(types) { 2944 Returns(types) {
2945 this.types = types; 2945 dart.initField(Returns, this, 'types', types);
2946 } 2946 }
2947 } 2947 }
2948 class JSName extends core.Object { 2948 class JSName extends core.Object {
2949 JSName(name) { 2949 JSName(name) {
2950 this.name = name; 2950 dart.initField(JSName, this, 'name', name);
2951 } 2951 }
2952 } 2952 }
2953 // Function boolConversionCheck: (dynamic) → dynamic 2953 // Function boolConversionCheck: (dynamic) → dynamic
2954 function boolConversionCheck(value) { 2954 function boolConversionCheck(value) {
2955 if (typeof value == 'boolean') 2955 if (typeof value == 'boolean')
2956 return value; 2956 return value;
2957 boolTypeCheck(value); 2957 boolTypeCheck(value);
2958 dart.assert(value != null); 2958 dart.assert(value != null);
2959 return false; 2959 return false;
2960 } 2960 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
3214 } 3214 }
3215 } 3215 }
3216 dart.defineLazyClass(exports, { 3216 dart.defineLazyClass(exports, {
3217 get JavaScriptIndexingBehavior() { 3217 get JavaScriptIndexingBehavior() {
3218 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {} 3218 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {}
3219 return JavaScriptIndexingBehavior; 3219 return JavaScriptIndexingBehavior;
3220 } 3220 }
3221 }); 3221 });
3222 class TypeErrorImplementation extends core.Error { 3222 class TypeErrorImplementation extends core.Error {
3223 TypeErrorImplementation(value, type) { 3223 TypeErrorImplementation(value, type) {
3224 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`; 3224 dart.initField(TypeErrorImplementation, this, 'message', `type '${Primitiv es.objectTypeName(value)}' is not a subtype ` + `of type '${type}'`);
3225 super.Error(); 3225 super.Error();
3226 } 3226 }
3227 fromMessage(message) { 3227 fromMessage(message) {
3228 this.message = message; 3228 dart.initField(TypeErrorImplementation, this, 'message', message);
3229 super.Error(); 3229 super.Error();
3230 } 3230 }
3231 toString() { 3231 toString() {
3232 return this.message; 3232 return this.message;
3233 } 3233 }
3234 } 3234 }
3235 TypeErrorImplementation[dart.implements] = () => [core.TypeError]; 3235 TypeErrorImplementation[dart.implements] = () => [core.TypeError];
3236 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage'); 3236 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage');
3237 class CastErrorImplementation extends core.Error { 3237 class CastErrorImplementation extends core.Error {
3238 CastErrorImplementation(actualType, expectedType) { 3238 CastErrorImplementation(actualType, expectedType) {
3239 this.message = `CastError: Casting value of type ${actualType} to` + ` inc ompatible type ${expectedType}`; 3239 dart.initField(CastErrorImplementation, this, 'message', `CastError: Casti ng value of type ${actualType} to` + ` incompatible type ${expectedType}`);
3240 super.Error(); 3240 super.Error();
3241 } 3241 }
3242 toString() { 3242 toString() {
3243 return this.message; 3243 return this.message;
3244 } 3244 }
3245 } 3245 }
3246 CastErrorImplementation[dart.implements] = () => [core.CastError]; 3246 CastErrorImplementation[dart.implements] = () => [core.CastError];
3247 class FallThroughErrorImplementation extends core.FallThroughError { 3247 class FallThroughErrorImplementation extends core.FallThroughError {
3248 FallThroughErrorImplementation() { 3248 FallThroughErrorImplementation() {
3249 super.FallThroughError(); 3249 super.FallThroughError();
(...skipping 18 matching lines...) Expand all
3268 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) { 3268 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) {
3269 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String) ); 3269 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String) );
3270 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L ist), new (core.Map$(core.Symbol, dart.dynamic))(), dart.as(expectedArgumentName s, core.List)); 3270 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L ist), new (core.Map$(core.Symbol, dart.dynamic))(), dart.as(expectedArgumentName s, core.List));
3271 } 3271 }
3272 // Function throwCyclicInit: (String) → void 3272 // Function throwCyclicInit: (String) → void
3273 function throwCyclicInit(staticName) { 3273 function throwCyclicInit(staticName) {
3274 throw new core.CyclicInitializationError(`Cyclic initialization for static $ {staticName}`); 3274 throw new core.CyclicInitializationError(`Cyclic initialization for static $ {staticName}`);
3275 } 3275 }
3276 class RuntimeError extends core.Error { 3276 class RuntimeError extends core.Error {
3277 RuntimeError(message) { 3277 RuntimeError(message) {
3278 this.message = message; 3278 dart.initField(RuntimeError, this, 'message', message);
3279 super.Error(); 3279 super.Error();
3280 } 3280 }
3281 toString() { 3281 toString() {
3282 return `RuntimeError: ${this.message}`; 3282 return `RuntimeError: ${this.message}`;
3283 } 3283 }
3284 } 3284 }
3285 class DeferredNotLoadedError extends core.Error { 3285 class DeferredNotLoadedError extends core.Error {
3286 DeferredNotLoadedError(libraryName) { 3286 DeferredNotLoadedError(libraryName) {
3287 this.libraryName = libraryName; 3287 dart.initField(DeferredNotLoadedError, this, 'libraryName', libraryName);
3288 super.Error(); 3288 super.Error();
3289 } 3289 }
3290 toString() { 3290 toString() {
3291 return `Deferred library ${this.libraryName} was not loaded.`; 3291 return `Deferred library ${this.libraryName} was not loaded.`;
3292 } 3292 }
3293 } 3293 }
3294 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError]; 3294 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError];
3295 class RuntimeType extends core.Object { 3295 class RuntimeType extends core.Object {
3296 RuntimeType() { 3296 RuntimeType() {
3297 } 3297 }
3298 } 3298 }
3299 let _isTest = Symbol('_isTest'); 3299 let _isTest = Symbol('_isTest');
3300 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom'); 3300 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom');
3301 let _asCheck = Symbol('_asCheck'); 3301 let _asCheck = Symbol('_asCheck');
3302 let _check = Symbol('_check'); 3302 let _check = Symbol('_check');
3303 let _assertCheck = Symbol('_assertCheck'); 3303 let _assertCheck = Symbol('_assertCheck');
3304 class RuntimeFunctionType extends RuntimeType { 3304 class RuntimeFunctionType extends RuntimeType {
3305 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name dParameters) { 3305 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name dParameters) {
3306 this.returnType = returnType; 3306 dart.initField(RuntimeFunctionType, this, 'returnType', returnType);
3307 this.parameterTypes = parameterTypes; 3307 dart.initField(RuntimeFunctionType, this, 'parameterTypes', parameterTypes );
3308 this.optionalParameterTypes = optionalParameterTypes; 3308 dart.initField(RuntimeFunctionType, this, 'optionalParameterTypes', option alParameterTypes);
3309 this.namedParameters = namedParameters; 3309 dart.initField(RuntimeFunctionType, this, 'namedParameters', namedParamete rs);
3310 super.RuntimeType(); 3310 super.RuntimeType();
3311 } 3311 }
3312 get isVoid() { 3312 get isVoid() {
3313 return dart.is(this.returnType, VoidRuntimeType); 3313 return dart.is(this.returnType, VoidRuntimeType);
3314 } 3314 }
3315 [_isTest](expression) { 3315 [_isTest](expression) {
3316 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression); 3316 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression);
3317 return functionTypeObject == null ? false : isFunctionSubtype(functionType Object, this.toRti()); 3317 return functionTypeObject == null ? false : isFunctionSubtype(functionType Object, this.toRti());
3318 } 3318 }
3319 [_asCheck](expression) { 3319 [_asCheck](expression) {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
3517 } 3517 }
3518 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime Type)), rti); 3518 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime Type)), rti);
3519 } else if ("func" in rti) { 3519 } else if ("func" in rti) {
3520 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); 3520 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType();
3521 } else { 3521 } else {
3522 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru ntimeType.`); 3522 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru ntimeType.`);
3523 } 3523 }
3524 } 3524 }
3525 class RuntimeTypePlain extends RuntimeType { 3525 class RuntimeTypePlain extends RuntimeType {
3526 RuntimeTypePlain(name) { 3526 RuntimeTypePlain(name) {
3527 this.name = name; 3527 dart.initField(RuntimeTypePlain, this, 'name', name);
3528 super.RuntimeType(); 3528 super.RuntimeType();
3529 } 3529 }
3530 toRti() { 3530 toRti() {
3531 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES); 3531 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES);
3532 let rti = allClasses[this.name]; 3532 let rti = allClasses[this.name];
3533 if (rti == null) 3533 if (rti == null)
3534 throw `no type for '${this.name}'`; 3534 throw `no type for '${this.name}'`;
3535 return rti; 3535 return rti;
3536 } 3536 }
3537 toString() { 3537 toString() {
3538 return this.name; 3538 return this.name;
3539 } 3539 }
3540 } 3540 }
3541 class RuntimeTypeGeneric extends RuntimeType { 3541 class RuntimeTypeGeneric extends RuntimeType {
3542 RuntimeTypeGeneric(name, arguments$, rti) { 3542 RuntimeTypeGeneric(name, arguments$, rti) {
3543 this.name = name; 3543 dart.initField(RuntimeTypeGeneric, this, 'name', name);
3544 this.arguments = arguments$; 3544 dart.initField(RuntimeTypeGeneric, this, 'arguments', arguments$);
3545 this.rti = rti; 3545 dart.initField(RuntimeTypeGeneric, this, 'rti', rti);
3546 super.RuntimeType(); 3546 super.RuntimeType();
3547 } 3547 }
3548 toRti() { 3548 toRti() {
3549 if (this.rti != null) 3549 if (this.rti != null)
3550 return this.rti; 3550 return this.rti;
3551 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES); 3551 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES);
3552 let result = [allClasses[this.name]]; 3552 let result = [allClasses[this.name]];
3553 if (dart.dindex(result, 0) == null) { 3553 if (dart.dindex(result, 0) == null) {
3554 throw `no type for '${this.name}<...>'`; 3554 throw `no type for '${this.name}<...>'`;
3555 } 3555 }
(...skipping 12 matching lines...) Expand all
3568 let _returnType = Symbol('_returnType'); 3568 let _returnType = Symbol('_returnType');
3569 let _isVoid = Symbol('_isVoid'); 3569 let _isVoid = Symbol('_isVoid');
3570 let _hasArguments = Symbol('_hasArguments'); 3570 let _hasArguments = Symbol('_hasArguments');
3571 let _hasOptionalArguments = Symbol('_hasOptionalArguments'); 3571 let _hasOptionalArguments = Symbol('_hasOptionalArguments');
3572 let _optionalArguments = Symbol('_optionalArguments'); 3572 let _optionalArguments = Symbol('_optionalArguments');
3573 let _hasNamedArguments = Symbol('_hasNamedArguments'); 3573 let _hasNamedArguments = Symbol('_hasNamedArguments');
3574 let _namedArguments = Symbol('_namedArguments'); 3574 let _namedArguments = Symbol('_namedArguments');
3575 let _convert = Symbol('_convert'); 3575 let _convert = Symbol('_convert');
3576 class FunctionTypeInfoDecoderRing extends core.Object { 3576 class FunctionTypeInfoDecoderRing extends core.Object {
3577 FunctionTypeInfoDecoderRing(typeData) { 3577 FunctionTypeInfoDecoderRing(typeData) {
3578 this[_typeData] = typeData; 3578 dart.initField(FunctionTypeInfoDecoderRing, this, _typeData, typeData);
3579 this[_cachedToString] = null; 3579 dart.initField(FunctionTypeInfoDecoderRing, this, _cachedToString, null);
3580 } 3580 }
3581 get [_hasReturnType]() { 3581 get [_hasReturnType]() {
3582 return "ret" in this[_typeData]; 3582 return "ret" in this[_typeData];
3583 } 3583 }
3584 get [_returnType]() { 3584 get [_returnType]() {
3585 return this[_typeData].ret; 3585 return this[_typeData].ret;
3586 } 3586 }
3587 get [_isVoid]() { 3587 get [_isVoid]() {
3588 return !!this[_typeData].void; 3588 return !!this[_typeData].void;
3589 } 3589 }
(...skipping 453 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/_native_typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698