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.

BigInt should be allowed to use as object key

See original GitHub issue
require('meriyah').parse('{1n:1n}',{next:true})
Uncaught [ParseError [SyntaxError]: [1:4]: Unexpected token: ':'
] {
  index: 4,
  line: 1,
  column: 4,
  description: "[1:4]: Unexpected token: ':'",
  loc: { line: 1, column: 4 }
}
console.log({1n:1})
{ '1': 1 }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
3cpcommented, Oct 28, 2020

yes, I am adding the line to parseLiteral, if you add the line outside of parseLiteral, you need to add it in many places after Token.IsStringOrNumber check.

1reaction
KFlashcommented, Oct 28, 2020

It’s a valid case. BigInt can be a property key. Also for Class

Read more comments on GitHub >

github_iconTop Results From Across the Web

BigInt - JavaScript - MDN Web Docs
BigInt values represent numeric values which are too large to be represented by the number primitive.
Read more >
Is there any way to use a numeric type as an object key?
No, this is not possible. The key will always be converted to a string. See Property Accessor docs. Property names must be strings....
Read more >
BigInt in JavaScript - GeeksforGeeks
BigInt is a built-in object in JavaScript that provides a way to represent whole numbers larger than 2 53 -1.
Read more >
What is BigInt in JavaScript, Why was BigInt needed, and how ...
We look into BigInt in JavaScript in Depth and see how Big. ... BigInt in JavaScript 07:43 JavaScript Math object cannot be used...
Read more >
All about the BigInt - New Javascript Data Type - YouTube
We will take a dive into a ECMAscript 2020 feature coming soon to Javascript: the BigInt primitive data type. Learn everything you need...
Read more >

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