Index: tool/input_sdk/private/ddc_runtime/operations.dart |
diff --git a/tool/input_sdk/private/ddc_runtime/operations.dart b/tool/input_sdk/private/ddc_runtime/operations.dart |
index c6d58bbdd172e7ad344880fd2ec34e55f5694403..e5de57819ebfbf26a955a6cf72c86788c9811169 100644 |
--- a/tool/input_sdk/private/ddc_runtime/operations.dart |
+++ b/tool/input_sdk/private/ddc_runtime/operations.dart |
@@ -499,6 +499,18 @@ runtimeType(obj) { |
return JS('', '#.runtimeType', obj); |
} |
+/// Implements Dart's interpolated strings as ES2015 tagged template literals. |
+/// |
+/// For example: dart.str`hello ${name}` |
+String str(strings, @rest values) => JS('', '''(() => { |
+ let s = $strings[0]; |
+ for (let i = 0, len = $values.length; i < len; ) { |
+ s += $_toString($values[i]) + $strings[++i]; |
+ } |
+ return s; |
+})()'''); |
+ |
+ |
final JsIterator = JS('', ''' |
class JsIterator { |
constructor(dartIterator) { |