Open
Description
Bug Report
The TemplateStringsArray
we emit for tagged templates (as well as its raw
property) should be frozen when we emit to --target ES5
, to match the ES2015 specification. Without this change, developers could run into issues with a spec-compliant String.dedent
polyfill. This was first reported here: tc39/proposal-string-dedent#75 (comment)
🔎 Search Terms
tagged template array frozen TemplateStringsArray
⏯ Playground Link
Playground link with relevant code
💻 Code
const f = (ar: TemplateStringsArray, ...args) => ar;
const x = f`a${1}b`
console.log(Object.isFrozen(x));
console.log(Object.isFrozen(x.raw));
🙁 Actual behavior
Neither the TemplateStringsArray
nor its raw
property are frozen.
🙂 Expected behavior
Both the TemplateStringsArray
and its raw
property should be frozen.