Intent to ship: ES6 Template Literals

54 views
Skip to first unread message

Erik Arvidsson

unread,
Dec 17, 2014, 10:32:13 AM12/17/14
to v8-u...@googlegroups.com, blink-dev
[blink-dev: FYI]

Template Literals are part of ES6. The spec in the Editor's draft is stable [1].

Firefox is shipping template literals since version 34 [2].
IE has template literals in a preview release [3].

Owners: a...@chromium.org, caitpo...@gmail.com

[1] https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literals
[2] https://developer.mozilla.org/en-US/Firefox/Releases/34
[3] https://status.modern.ie/templatestringses6

Joshua Bell

unread,
Dec 17, 2014, 12:31:07 PM12/17/14
to v8-u...@googlegroups.com, blink-dev
Any caveats?

Does this include the use of tags (i.e. tag`literal`;) ?

Does this include String.raw()?

(IMHO a subset w/o either of those is both useful and noncontroversial, I'm just curious if this Intent includes all the bells and whistles)



--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Caitlin Potter

unread,
Dec 17, 2014, 12:41:48 PM12/17/14
to v8-u...@googlegroups.com, blin...@chromium.org
Tagged templates and String.raw are both implemented

PhistucK

unread,
Dec 17, 2014, 2:13:39 PM12/17/14
to Joshua Bell, v8-users, blink-dev
​A bit off topic, but how is (from MDN) String.raw`bla\n${5+6}` any different from ​simply `bla\n${5+6}`?
(MDN also shows  - console.log(`Fifteen is ${a + b} and not ${2 * a + b}.`); - without any String.raw or anything, so why would one need String.raw?)

Or is the MDN example simply not so great and it is supposed to be String.raw("bla\n${5+6}")?


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Erik Arvidsson

unread,
Dec 17, 2014, 2:15:42 PM12/17/14
to v8-u...@googlegroups.com, Joshua Bell, blink-dev
With String.raw `\n` you get "\\n" versus with `\n` you get "\n".
--
erik

PhistucK

unread,
Dec 17, 2014, 2:27:29 PM12/17/14
to Erik Arvidsson, v8-users, Joshua Bell, blink-dev
Oh, right. I get it now, thank you!


PhistucK
Reply all
Reply to author
Forward
0 new messages