question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Meriyah does not properly follow ECMA standards on function declaration and calling.

See original GitHub issue

When experimenting with Meriyah, I discovered the parser properly registers the following invalid function declarations and calls:

function 10() {
   return 10;
}

10();
function "string"() {
   return "string"();
}

"string"();

Meriyah also struggles when calling functions. It will assume that the name of the function being called is an identifier, and not a literal.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
3cpcommented, Mar 8, 2021

NVM, my mistake, []() and ({}()) is runtime error too 😃

1reaction
3cpcommented, Mar 5, 2021

Other parsers like acorn and TS do not reject them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found