[Webkit-unassigned] [Bug 206888] New: [ESNext][BigInt] We don't support BigInt literal as PropertyName
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 28 09:52:43 PST 2020
https://bugs.webkit.org/show_bug.cgi?id=206888
Bug ID: 206888
Summary: [ESNext][BigInt] We don't support BigInt literal as
PropertyName
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: ticaiolima at gmail.com
According to spec, BigInt is a valid PropertyName (https://tc39.es/ecma262/#prod-PropertyName) and it should be evaluated using ToString (https://tc39.es/ecma262/#sec-object-initializer-runtime-semantics-evaluation). Given this, this script should be evaluated without error:
```
// Object Literal
let o = { 1n: "foo" };
assert(a[1n] === "foo");
assert(a[1] === "foo");
assert(a["1"] === "foo");
// MethodDeclaration
o = { 1n() => "bar" };
assert(a[1n]() === "bar");
assert(a[1]() === "bar");
assert(a["1"]() === "bar");
class C {
1n() { return "baz"; }
}
let c = new C();
assert(c.[1n]() === "baz");
assert(c.[1]() === "baz");
assert(c.["1"] === "baz");
// Destructuring
let {1n: a} = {1n: "foo"};
assert(a === "foo");
```
Original report from https://bugzilla.mozilla.org/show_bug.cgi?id=1605835
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200128/665c77e3/attachment.htm>
More information about the webkit-unassigned
mailing list