espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

.join`` doesn't work #2475

Closed KTibow closed 3 months ago

KTibow commented 3 months ago
[1, 2].join("") // works fine
[1, 2].join`` // works fine in browsers but not in espruino, should be "12", instead is ""
gfwilliams commented 3 months ago

Ok, I just looked this up and it's JS's 'Tagged Templates': https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates

Do you have a legitimate use for this feature?

Because honestly this looks like one of those bits of JS spec that seems really clunky - so I'm tempted just to ensure that Espruino errors rather than bloating it with a feature that I don't believe many people will use.

KTibow commented 3 months ago

I would be fine if it errors. The only main uses outside of Espruino are tagged templates for HTML and using String.raw.

gfwilliams commented 3 months ago

Ok, cool. Just added