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

Unified Diff: lib/compiler/implementation/js_backend/constant_system_javascript.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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/js_backend/constant_system_javascript.dart
===================================================================
--- lib/compiler/implementation/js_backend/constant_system_javascript.dart (revision 12329)
+++ lib/compiler/implementation/js_backend/constant_system_javascript.dart (working copy)
@@ -217,4 +217,11 @@
bool isString(Constant constant) => constant.isString();
bool isBool(Constant constant) => constant.isBool();
bool isNull(Constant constant) => constant.isNull();
-}
+
+ bool isSubtype(Compiler compiler, DartType s, DartType t) {
+ if (s.element == compiler.intClass && t.element == compiler.doubleClass) {
kasperl 2012/09/14 05:53:34 Add a comment that explains why this is -- and why
ngeoffray 2012/09/14 09:44:56 Done.
+ return true;
+ }
+ return compiler.types.isSubtype(s, t);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698