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

Wrong TemplateElement value #109

Closed
fisker opened this issue Oct 13, 2020 · 2 comments · Fixed by #114
Closed

Wrong TemplateElement value #109

fisker opened this issue Oct 13, 2020 · 2 comments · Fixed by #114

Comments

@fisker
Copy link
Collaborator

fisker commented Oct 13, 2020

require('meriyah').parse('tagA`a`\ntagB`b`', {ranges: true, loc: true}).body[0].expression.quasi.quasis[0].value
{ cooked: 'tagB', raw: 'a' }

Node.value.cooked should be a

@3cp
Copy link
Member

3cp commented Oct 15, 2020

@KFlash where can I find the spec for "cooked"?

In estree spec repo, I can only find

If the template literal is tagged and the text has an invalid escape, cooked will be null, e.g., tag\unicode and \u{55}

@KFlash
Copy link
Contributor

KFlash commented Oct 15, 2020

That's the problem with ESTree. See the specs. All invalid tagged template should be null. All other values should be as they are without the tick and non-escapes. Example '0x65' should be latter a (cooked). Else it's raw

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