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

Side by Side Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 1994613004: Handle use of constant constructors with default values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 // 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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 } 1404 }
1405 } 1405 }
1406 1406
1407 @override 1407 @override
1408 bool get isConst { 1408 bool get isConst {
1409 _ensureConstant(); 1409 _ensureConstant();
1410 return _isConst; 1410 return _isConst;
1411 } 1411 }
1412 1412
1413 @override 1413 @override
1414 bool get hasConstant => true;
1415
1416 @override
1414 ConstantExpression get constant { 1417 ConstantExpression get constant {
1415 _ensureConstant(); 1418 _ensureConstant();
1416 return _constant; 1419 return _constant;
1417 } 1420 }
1418 1421
1419 @override 1422 @override
1420 Expression get initializer => _unsupported('initializer'); 1423 Expression get initializer => _unsupported('initializer');
1421 } 1424 }
1422 1425
1423 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
1851 1854
1852 ParameterElementZ(ObjectDecoder decoder) : super(decoder); 1855 ParameterElementZ(ObjectDecoder decoder) : super(decoder);
1853 1856
1854 @override 1857 @override
1855 bool get isFinal => _decoder.getBool(Key.IS_FINAL); 1858 bool get isFinal => _decoder.getBool(Key.IS_FINAL);
1856 1859
1857 @override 1860 @override
1858 bool get isConst => false; 1861 bool get isConst => false;
1859 1862
1860 @override 1863 @override
1864 bool get hasConstant => true;
1865
1866 @override
1861 ConstantExpression get constant { 1867 ConstantExpression get constant {
1862 if (isOptional) { 1868 if (isOptional) {
1863 if (_constant == null) { 1869 if (_constant == null) {
1864 _constant = _decoder.getConstant(Key.CONSTANT); 1870 _constant = _decoder.getConstant(Key.CONSTANT);
1865 } 1871 }
1866 return _constant; 1872 return _constant;
1867 } 1873 }
1868 return null; 1874 return null;
1869 } 1875 }
1870 1876
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 @override 1985 @override
1980 bool get isConst { 1986 bool get isConst {
1981 if (_isConst == null) { 1987 if (_isConst == null) {
1982 _constant = _decoder.getConstant(Key.CONSTANT, isOptional: true); 1988 _constant = _decoder.getConstant(Key.CONSTANT, isOptional: true);
1983 _isConst = _constant != null; 1989 _isConst = _constant != null;
1984 } 1990 }
1985 return _isConst; 1991 return _isConst;
1986 } 1992 }
1987 1993
1988 @override 1994 @override
1995 bool get hasConstant => true;
1996
1997 @override
1989 ConstantExpression get constant { 1998 ConstantExpression get constant {
1990 if (isConst) { 1999 if (isConst) {
1991 return _constant; 2000 return _constant;
1992 } 2001 }
1993 return null; 2002 return null;
1994 } 2003 }
1995 2004
1996 @override 2005 @override
1997 Expression get initializer => _unsupported('initializer'); 2006 Expression get initializer => _unsupported('initializer');
1998 } 2007 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 } 2136 }
2128 2137
2129 @override 2138 @override
2130 ElementKind get kind => ElementKind.PREFIX; 2139 ElementKind get kind => ElementKind.PREFIX;
2131 2140
2132 @override 2141 @override
2133 Element lookupLocalMember(String memberName) { 2142 Element lookupLocalMember(String memberName) {
2134 return _unsupported('lookupLocalMember'); 2143 return _unsupported('lookupLocalMember');
2135 } 2144 }
2136 } 2145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698