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 range CallExpression inside template #123

Closed
fisker opened this issue Oct 27, 2020 · 1 comment
Closed

Wrong range CallExpression inside template #123

fisker opened this issue Oct 27, 2020 · 1 comment

Comments

@fisker
Copy link
Collaborator

fisker commented Oct 27, 2020

This one

`${a}|${// 1
b}`

and

`${a}|${// 1
b()}`

The second one b() has wrong location

require("meriyah").parse('`${a}|${// 1\nb}`', {loc: true,ranges:true}).body[0].expression.expressions[1]
{
  type: 'Identifier',
  name: 'b',
  start: 13,
  end: 14,
  range: [ 13, 14 ],
  loc: { start: { line: 2, column: 0 }, end: { line: 2, column: 1 } }
}
require("meriyah").parse('`${a}|${// 1\nb()}`', {loc: true,ranges:true}).body[0].expression.expressions[1]
{
  type: 'CallExpression',
  callee: {
    type: 'Identifier',
    name: 'b',
    start: 13,
    end: 14,
    range: [ 13, 14 ],
    loc: { start: [Object], end: [Object] }
  },
  arguments: [],
  start: 4,
  end: 16,
  range: [ 4, 16 ],
  loc: { start: { line: 1, column: 4 }, end: { line: 2, column: 3 } }
}

The loc.start should be the same.

@3cp 3cp closed this as completed in aa0e992 Oct 27, 2020
@3cp
Copy link
Member

3cp commented Oct 27, 2020

Released all latest code in v3.1.0

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