OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library dart2js.constant_system.dart; | 5 library dart2js.constant_system.dart; |
6 | 6 |
7 import 'compiler.dart' show Compiler; | 7 import 'compiler.dart' show Compiler; |
8 import 'constants/constant_system.dart'; | 8 import 'constants/constant_system.dart'; |
9 import 'constants/values.dart'; | 9 import 'constants/values.dart'; |
10 import 'dart_types.dart'; | 10 import 'dart_types.dart'; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 @override | 444 @override |
445 ConstantValue createType(Compiler compiler, DartType type) { | 445 ConstantValue createType(Compiler compiler, DartType type) { |
446 // TODO(johnniwinther): Change the `Type` type to | 446 // TODO(johnniwinther): Change the `Type` type to |
447 // `compiler.coreTypes.typeType` and check the backend specific value in | 447 // `compiler.coreTypes.typeType` and check the backend specific value in |
448 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'. | 448 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'. |
449 return new TypeConstantValue(type, | 449 return new TypeConstantValue(type, |
450 compiler.backend.typeImplementation.computeType(compiler.resolution)); | 450 compiler.backend.typeImplementation.computeType(compiler.resolution)); |
451 } | 451 } |
452 | 452 |
| 453 @override |
| 454 ConstantValue createSymbol(Compiler compiler, String text) { |
| 455 throw new UnsupportedError('DartConstantSystem.evaluate'); |
| 456 } |
| 457 |
453 bool isInt(ConstantValue constant) => constant.isInt; | 458 bool isInt(ConstantValue constant) => constant.isInt; |
454 bool isDouble(ConstantValue constant) => constant.isDouble; | 459 bool isDouble(ConstantValue constant) => constant.isDouble; |
455 bool isString(ConstantValue constant) => constant.isString; | 460 bool isString(ConstantValue constant) => constant.isString; |
456 bool isBool(ConstantValue constant) => constant.isBool; | 461 bool isBool(ConstantValue constant) => constant.isBool; |
457 bool isNull(ConstantValue constant) => constant.isNull; | 462 bool isNull(ConstantValue constant) => constant.isNull; |
458 | 463 |
459 bool isSubtype(DartTypes types, DartType s, DartType t) { | 464 bool isSubtype(DartTypes types, DartType s, DartType t) { |
460 return types.isSubtype(s, t); | 465 return types.isSubtype(s, t); |
461 } | 466 } |
462 } | 467 } |
OLD | NEW |