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

Unified Diff: test/mjsunit/es6/templates.js

Issue 1184373002: [parser] parse `CalllExpression TemplateLiteral` production (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « src/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"; },
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698