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

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

Issue 1249043006: fix truncate call to use extension method (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 5 years, 5 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 | « lib/runtime/dart/math.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 08b43262ada627d8a6b60442cc7f66f941a0a585..c2917cdf4d5985462eb3f69ebccc1fd36b393214 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -2014,7 +2014,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor {
// instead of special cases here.
if (op.type == TokenType.TILDE_SLASH) {
// `a ~/ b` is equivalent to `(a / b).truncate()`
- code = '(# / #).truncate()';
+ var div = AstBuilder.binaryExpression(left, '/', right)
+ ..staticType = node.staticType;
+ return _emitSend(div, 'truncate', []);
} else {
// TODO(vsm): When do Dart ops not map to JS?
code = '# $op #';
« no previous file with comments | « lib/runtime/dart/math.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698