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

Side by Side Diff: lib/compiler/implementation/constant_system.dart

Issue 10916232: Implement checked mode for const constructors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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 interface Operation { 5 interface Operation {
6 final SourceString name; 6 final SourceString name;
7 bool isUserDefinable(); 7 bool isUserDefinable();
8 } 8 }
9 9
10 interface UnaryOperation extends Operation { 10 interface UnaryOperation extends Operation {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 BinaryOperation get subtract; 44 BinaryOperation get subtract;
45 BinaryOperation get truncatingDivide; 45 BinaryOperation get truncatingDivide;
46 46
47 Constant createInt(int i); 47 Constant createInt(int i);
48 Constant createDouble(double d); 48 Constant createDouble(double d);
49 // We need a diagnostic node to report errors in case the string is malformed. 49 // We need a diagnostic node to report errors in case the string is malformed.
50 Constant createString(DartString string, Node diagnosticNode); 50 Constant createString(DartString string, Node diagnosticNode);
51 Constant createBool(bool value); 51 Constant createBool(bool value);
52 Constant createNull(); 52 Constant createNull();
53 53
54 // We need to special case the subtype check for JavaScript constant
55 // system because an int is a double at runtime.
56 bool isSubtype(Compiler compiler, DartType s, DartType t);
57
54 /** Returns true if the [constant] is an integer at runtime. */ 58 /** Returns true if the [constant] is an integer at runtime. */
55 bool isInt(Constant constant); 59 bool isInt(Constant constant);
56 /** Returns true if the [constant] is a double at runtime. */ 60 /** Returns true if the [constant] is a double at runtime. */
57 bool isDouble(Constant constant); 61 bool isDouble(Constant constant);
58 /** Returns true if the [constant] is a string at runtime. */ 62 /** Returns true if the [constant] is a string at runtime. */
59 bool isString(Constant constant); 63 bool isString(Constant constant);
60 /** Returns true if the [constant] is a boolean at runtime. */ 64 /** Returns true if the [constant] is a boolean at runtime. */
61 bool isBool(Constant constant); 65 bool isBool(Constant constant);
62 /** Returns true if the [constant] is null at runtime. */ 66 /** Returns true if the [constant] is null at runtime. */
63 bool isNull(Constant constant); 67 bool isNull(Constant constant);
64 } 68 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/constant_system_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698