Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagged template literal breaks arrow function #190

Closed
lettertwo opened this issue Mar 21, 2019 · 1 comment
Closed

Tagged template literal breaks arrow function #190

lettertwo opened this issue Mar 21, 2019 · 1 comment

Comments

@lettertwo
Copy link

…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.

Actual:
code errors on eval: 'Unexpected identifier`.

See repro on code sandbox

@adrianheine
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants