Closed lettertwo closed 5 years ago
…or maybe arrow function transform breaks tagged template literal?
Example:
const src = "() => tagged`template literal`"; const { code } = transform(src, { transforms: { dangerousTaggedTemplateString: true } }); eval(code);
Expected: code is valid javascript and can eval without error.
code
eval
Actual: code errors on eval: 'Unexpected identifier`.
See repro on code sandbox
Nice catch! Apparently this issue is specific to having an input start with an arrow function expression (or some other syntax element whose start is modified) and include a tagged template expression.
…or maybe arrow function transform breaks tagged template literal?
Example:
Expected:
code
is valid javascript and caneval
without error.Actual:
code
errors oneval
: 'Unexpected identifier`.See repro on code sandbox