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

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

Issue 1989663002: fix #470, string interpolation now respects Dart toString (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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_sdk.js ('k') | test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index 05d603f8de8c428c91f543740d95d541006ad1c7..69805bf75e416ed6be14f1faef765172408e6c2e 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -4188,11 +4188,9 @@ class CodeGenerator extends GeneralizingAstVisitor
_visitListToBinary(node.strings, '+');
@override
- JS.TemplateString visitStringInterpolation(StringInterpolation node) {
- // Assuming we implement toString() on our objects, we can avoid calling it
- // in most cases. Builtin types may differ though. We could handle this with
- // a tagged template.
- return new JS.TemplateString(_visitList(node.elements));
+ JS.Expression visitStringInterpolation(StringInterpolation node) {
+ return new JS.TaggedTemplate(
+ js.call('dart.str'), new JS.TemplateString(_visitList(node.elements)));
}
@override
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698