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

Unified Diff: lib/src/codegen/reify_coercions.dart

Issue 1649583002: allow JS builtin to be typed as needed (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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
Index: lib/src/codegen/reify_coercions.dart
diff --git a/lib/src/codegen/reify_coercions.dart b/lib/src/codegen/reify_coercions.dart
index 36c965e3fbd46383b701590f411c41eb3a075a78..3aead3ebf0403b7717d9f31dffb2838f6308e54a 100644
--- a/lib/src/codegen/reify_coercions.dart
+++ b/lib/src/codegen/reify_coercions.dart
@@ -12,6 +12,7 @@ import 'package:analyzer/src/generated/type_system.dart'
import 'package:logging/logging.dart' as logger;
import '../info.dart';
+import '../utils.dart' show isInlineJS;
import 'ast_builder.dart';
@@ -168,6 +169,10 @@ class CoercionManager {
Expression inner = coerceExpression(e.expression, c);
return new NamedExpression(e.name, inner);
}
+ if (e is MethodInvocation && isInlineJS(e.methodName.staticElement)) {
+ // Inline JS code should not need casts.
+ return e;
+ }
if (c is Cast) return _castExpression(e, c);
assert(c is Identity);
return e;

Powered by Google App Engine
This is Rietveld 408576698