Index: test/mjsunit/es6/templates.js |
diff --git a/test/mjsunit/es6/templates.js b/test/mjsunit/es6/templates.js |
index 0734f0e5d06936db4d7a6b684243894adaa0e1da..feb7364613db9391665f72700ea0608071945674 100644 |
--- a/test/mjsunit/es6/templates.js |
+++ b/test/mjsunit/es6/templates.js |
@@ -588,6 +588,26 @@ var global = this; |
})(); |
+(function testReturnValueAsTagFn() { |
+ "use strict"; |
+ var i = 0; |
+ function makeTag() { |
+ return function tag(cs) { |
+ var args = Array.prototype.slice.call(arguments, 1); |
+ var rcs = []; |
+ rcs.raw = cs.map(function(s) { |
+ return '!' + s + '!'; |
+ }); |
+ args.unshift(rcs); |
+ return String.raw.apply(null, args); |
+ } |
+ } |
+ assertEquals('!hi!', makeTag()`hi`); |
+ assertEquals('!test!0!test!', makeTag()`test${0}test`); |
+ assertEquals('!!', makeTag()``); |
+}); |
+ |
+ |
(function testToStringSubstitutions() { |
var a = { |
toString: function() { return "a"; }, |