You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use of ES6 tagged template literals is currently broken in Coffeescript, unless I'm missing a trick.
Since tagged template literals are not directly supported in Coffeescript, the obvious way of using them is to embed the Javascript directly, like:
`
vara=5;
varb=10;
functiontag(strings, ...values) {
return"Bazinga!";
};
tag`Hello ${ a + b } world ${ a * b }`;
`
However, testing this code on http://js2.coffee, I'm seeing 'unexpected identifier' error on the final "tag" line.
I'm assuming the root cause is that backticks are already used by Coffeescript to mark the start and end of the embedded Javascript section. As such, backticks can't also be used inside the embedded Javascript to make the tagged template literal call.
FYI, I ran into this problem when exploring the newish bel DOM templating library. Since it uses tagged template strings, I believe it's inoperable with current Coffeescript. This is the first time I've seen incompatibility between Coffeescript and Javascript..
The text was updated successfully, but these errors were encountered:
Use of ES6 tagged template literals is currently broken in Coffeescript, unless I'm missing a trick.
Since tagged template literals are not directly supported in Coffeescript, the obvious way of using them is to embed the Javascript directly, like:
However, testing this code on http://js2.coffee, I'm seeing 'unexpected identifier' error on the final "tag" line.
I'm assuming the root cause is that backticks are already used by Coffeescript to mark the start and end of the embedded Javascript section. As such, backticks can't also be used inside the embedded Javascript to make the tagged template literal call.
FYI, I ran into this problem when exploring the newish bel DOM templating library. Since it uses tagged template strings, I believe it's inoperable with current Coffeescript. This is the first time I've seen incompatibility between Coffeescript and Javascript..
The text was updated successfully, but these errors were encountered: