| Index: lib/src/codegen/js_codegen.dart
|
| diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
|
| index 8a769573489637c8247f625e89d4fc13b699bf65..4f9878a4fcec5d80451788ed1acbd417f027b36d 100644
|
| --- a/lib/src/codegen/js_codegen.dart
|
| +++ b/lib/src/codegen/js_codegen.dart
|
| @@ -253,6 +253,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
|
| var from = getStaticType(node.expression);
|
| var to = node.type.type;
|
|
|
| + // Skip the cast if it's not needed.
|
| + if (rules.isSubTypeOf(from, to)) return _visit(node.expression);
|
| +
|
| // All Dart number types map to a JS double.
|
| if (rules.isNumType(from) &&
|
| (rules.isIntType(to) || rules.isDoubleType(to))) {
|
|
|