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

Unified Diff: pkg/dev_compiler/lib/src/compiler/code_generator.dart

Issue 2638393004: Fix subtyping check on number (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index afabcf3a6cb464103b5cce1d8cd97a446732f367..56daf6b806275feb6cecffa1d04c9c9c330554c1 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -5624,7 +5624,9 @@ class CodeGenerator extends GeneralizingAstVisitor
///
/// JSNumber is the type that actually "implements" all numbers, hence it's
/// a subtype of int and double (and num). It's in our "dart:_interceptors".
- bool _isNumberInJS(DartType t) => rules.isSubtypeOf(t, types.numType);
+ bool _isNumberInJS(DartType t) =>
+ rules.isSubtypeOf(t, types.numType) &&
+ !rules.isSubtypeOf(t, types.nullType);
/// Return true if this is one of the methods/properties on all Dart Objects
/// (toString, hashCode, noSuchMethod, runtimeType).
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698