OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Implementation of the element model used for deserialiation. | 5 /// Implementation of the element model used for deserialiation. |
6 /// | 6 /// |
7 /// These classes are created by [ElementDeserializer] triggered by the | 7 /// These classes are created by [ElementDeserializer] triggered by the |
8 /// [Deserializer]. | 8 /// [Deserializer]. |
9 | 9 |
10 library dart2js.serialization.modelz; | 10 library dart2js.serialization.modelz; |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 return _constantConstructor; | 1101 return _constantConstructor; |
1102 } | 1102 } |
1103 | 1103 |
1104 @override | 1104 @override |
1105 AsyncMarker get asyncMarker => AsyncMarker.SYNC; | 1105 AsyncMarker get asyncMarker => AsyncMarker.SYNC; |
1106 | 1106 |
1107 @override | 1107 @override |
1108 ConstructorElement get definingConstructor => null; | 1108 ConstructorElement get definingConstructor => null; |
1109 | 1109 |
1110 @override | 1110 @override |
| 1111 bool get hasEffectiveTarget => true; |
| 1112 |
| 1113 @override |
1111 ConstructorElement get effectiveTarget { | 1114 ConstructorElement get effectiveTarget { |
1112 if (_effectiveTarget == null) { | 1115 if (_effectiveTarget == null) { |
1113 _effectiveTarget = | 1116 _effectiveTarget = |
1114 _decoder.getElement(Key.EFFECTIVE_TARGET, isOptional: true); | 1117 _decoder.getElement(Key.EFFECTIVE_TARGET, isOptional: true); |
1115 if (_effectiveTarget == null) { | 1118 if (_effectiveTarget == null) { |
1116 _effectiveTarget = this; | 1119 _effectiveTarget = this; |
1117 } | 1120 } |
1118 } | 1121 } |
1119 return _effectiveTarget; | 1122 return _effectiveTarget; |
1120 } | 1123 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 @override | 1252 @override |
1250 accept(ElementVisitor visitor, arg) { | 1253 accept(ElementVisitor visitor, arg) { |
1251 return visitor.visitConstructorElement(this, arg); | 1254 return visitor.visitConstructorElement(this, arg); |
1252 } | 1255 } |
1253 | 1256 |
1254 @override | 1257 @override |
1255 AsyncMarker get asyncMarker => AsyncMarker.SYNC; | 1258 AsyncMarker get asyncMarker => AsyncMarker.SYNC; |
1256 | 1259 |
1257 @override | 1260 @override |
1258 InterfaceType computeEffectiveTargetType(InterfaceType newType) { | 1261 InterfaceType computeEffectiveTargetType(InterfaceType newType) { |
1259 return enclosingClass.thisType; | 1262 return enclosingClass.thisType.substByContext(newType); |
1260 } | 1263 } |
1261 | 1264 |
1262 @override | 1265 @override |
1263 DartType computeType(Resolution resolution) => type; | 1266 DartType computeType(Resolution resolution) => type; |
1264 | 1267 |
1265 @override | 1268 @override |
1266 bool get isConst => false; | 1269 bool get isConst => false; |
1267 | 1270 |
1268 @override | 1271 @override |
1269 ConstantConstructor get constantConstructor => null; | 1272 ConstantConstructor get constantConstructor => null; |
1270 | 1273 |
1271 @override | 1274 @override |
| 1275 bool get hasEffectiveTarget => true; |
| 1276 |
| 1277 @override |
1272 ConstructorElement get effectiveTarget => this; | 1278 ConstructorElement get effectiveTarget => this; |
1273 | 1279 |
1274 @override | 1280 @override |
1275 Element get enclosingElement => enclosingClass; | 1281 Element get enclosingElement => enclosingClass; |
1276 | 1282 |
1277 @override | 1283 @override |
1278 FunctionSignature get functionSignature { | 1284 FunctionSignature get functionSignature { |
1279 // TODO(johnniwinther): Ensure that the function signature (and with it the | 1285 // TODO(johnniwinther): Ensure that the function signature (and with it the |
1280 // function type) substitutes type variables correctly. | 1286 // function type) substitutes type variables correctly. |
1281 return definingConstructor.functionSignature; | 1287 return definingConstructor.functionSignature; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 } | 1404 } |
1399 } | 1405 } |
1400 | 1406 |
1401 @override | 1407 @override |
1402 bool get isConst { | 1408 bool get isConst { |
1403 _ensureConstant(); | 1409 _ensureConstant(); |
1404 return _isConst; | 1410 return _isConst; |
1405 } | 1411 } |
1406 | 1412 |
1407 @override | 1413 @override |
| 1414 bool get hasConstant => true; |
| 1415 |
| 1416 @override |
1408 ConstantExpression get constant { | 1417 ConstantExpression get constant { |
1409 _ensureConstant(); | 1418 _ensureConstant(); |
1410 return _constant; | 1419 return _constant; |
1411 } | 1420 } |
1412 | 1421 |
1413 @override | 1422 @override |
1414 Expression get initializer => _unsupported('initializer'); | 1423 Expression get initializer => _unsupported('initializer'); |
1415 } | 1424 } |
1416 | 1425 |
1417 class TopLevelFieldElementZ extends FieldElementZ with LibraryMemberMixin { | 1426 class TopLevelFieldElementZ extends FieldElementZ with LibraryMemberMixin { |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 | 1854 |
1846 ParameterElementZ(ObjectDecoder decoder) : super(decoder); | 1855 ParameterElementZ(ObjectDecoder decoder) : super(decoder); |
1847 | 1856 |
1848 @override | 1857 @override |
1849 bool get isFinal => _decoder.getBool(Key.IS_FINAL); | 1858 bool get isFinal => _decoder.getBool(Key.IS_FINAL); |
1850 | 1859 |
1851 @override | 1860 @override |
1852 bool get isConst => false; | 1861 bool get isConst => false; |
1853 | 1862 |
1854 @override | 1863 @override |
| 1864 bool get hasConstant => true; |
| 1865 |
| 1866 @override |
1855 ConstantExpression get constant { | 1867 ConstantExpression get constant { |
1856 if (isOptional) { | 1868 if (isOptional) { |
1857 if (_constant == null) { | 1869 if (_constant == null) { |
1858 _constant = _decoder.getConstant(Key.CONSTANT); | 1870 _constant = _decoder.getConstant(Key.CONSTANT); |
1859 } | 1871 } |
1860 return _constant; | 1872 return _constant; |
1861 } | 1873 } |
1862 return null; | 1874 return null; |
1863 } | 1875 } |
1864 | 1876 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 @override | 1985 @override |
1974 bool get isConst { | 1986 bool get isConst { |
1975 if (_isConst == null) { | 1987 if (_isConst == null) { |
1976 _constant = _decoder.getConstant(Key.CONSTANT, isOptional: true); | 1988 _constant = _decoder.getConstant(Key.CONSTANT, isOptional: true); |
1977 _isConst = _constant != null; | 1989 _isConst = _constant != null; |
1978 } | 1990 } |
1979 return _isConst; | 1991 return _isConst; |
1980 } | 1992 } |
1981 | 1993 |
1982 @override | 1994 @override |
| 1995 bool get hasConstant => true; |
| 1996 |
| 1997 @override |
1983 ConstantExpression get constant { | 1998 ConstantExpression get constant { |
1984 if (isConst) { | 1999 if (isConst) { |
1985 return _constant; | 2000 return _constant; |
1986 } | 2001 } |
1987 return null; | 2002 return null; |
1988 } | 2003 } |
1989 | 2004 |
1990 @override | 2005 @override |
1991 Expression get initializer => _unsupported('initializer'); | 2006 Expression get initializer => _unsupported('initializer'); |
1992 } | 2007 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 } | 2136 } |
2122 | 2137 |
2123 @override | 2138 @override |
2124 ElementKind get kind => ElementKind.PREFIX; | 2139 ElementKind get kind => ElementKind.PREFIX; |
2125 | 2140 |
2126 @override | 2141 @override |
2127 Element lookupLocalMember(String memberName) { | 2142 Element lookupLocalMember(String memberName) { |
2128 return _unsupported('lookupLocalMember'); | 2143 return _unsupported('lookupLocalMember'); |
2129 } | 2144 } |
2130 } | 2145 } |
OLD | NEW |