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

Side by Side Diff: lib/compiler/implementation/constant_system_dart.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 const DART_CONSTANT_SYSTEM = const DartConstantSystem(); 5 const DART_CONSTANT_SYSTEM = const DartConstantSystem();
6 6
7 class BitNotOperation implements UnaryOperation { 7 class BitNotOperation implements UnaryOperation {
8 final SourceString name = const SourceString('~'); 8 final SourceString name = const SourceString('~');
9 bool isUserDefinable() => true; 9 bool isUserDefinable() => true;
10 const BitNotOperation(); 10 const BitNotOperation();
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 StringConstant createString(DartString string, Node diagnosticNode) 335 StringConstant createString(DartString string, Node diagnosticNode)
336 => new StringConstant(string, diagnosticNode); 336 => new StringConstant(string, diagnosticNode);
337 BoolConstant createBool(bool value) => new BoolConstant(value); 337 BoolConstant createBool(bool value) => new BoolConstant(value);
338 NullConstant createNull() => new NullConstant(); 338 NullConstant createNull() => new NullConstant();
339 339
340 bool isInt(Constant constant) => constant.isInt(); 340 bool isInt(Constant constant) => constant.isInt();
341 bool isDouble(Constant constant) => constant.isDouble(); 341 bool isDouble(Constant constant) => constant.isDouble();
342 bool isString(Constant constant) => constant.isString(); 342 bool isString(Constant constant) => constant.isString();
343 bool isBool(Constant constant) => constant.isBool(); 343 bool isBool(Constant constant) => constant.isBool();
344 bool isNull(Constant constant) => constant.isNull(); 344 bool isNull(Constant constant) => constant.isNull();
345 } 345
346 bool isSubtype(Compiler compiler, DartType s, DartType t) {
347 return compiler.types.isSubtype(s, t);
348 }
349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698