mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
update tests to follow review
This commit is contained in:
parent
7b1a828459
commit
eab9d3bd30
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2019 Igalia S.L, Toru Nagashima. All rights reserved.
|
// Copyright (C) 2020 Igalia S.L, Toru Nagashima. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
@ -33,28 +33,22 @@ let o = { 999999999999999999n: true }; // greater than max safe integer
|
|||||||
assert.sameValue(o["999999999999999999"], true,
|
assert.sameValue(o["999999999999999999"], true,
|
||||||
"the property name must be the string representation of the numeric value.");
|
"the property name must be the string representation of the numeric value.");
|
||||||
|
|
||||||
o = { 1n: "foo" };
|
|
||||||
assert.sameValue(o[1n], "foo");
|
|
||||||
assert.sameValue(o[1], "foo");
|
|
||||||
assert.sameValue(o["1"], "foo");
|
|
||||||
|
|
||||||
// MethodDeclaration
|
// MethodDeclaration
|
||||||
|
|
||||||
o = { 1n() { return "bar"; } };
|
o = { 1n() { return "bar"; } };
|
||||||
assert.sameValue(o[1n](), "bar");
|
assert.sameValue(o["1"](), "bar",
|
||||||
assert.sameValue(o[1](), "bar");
|
"the property name must be the string representation of the numeric value.");
|
||||||
assert.sameValue(o["1"](), "bar");
|
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
1n() { return "baz"; }
|
1n() { return "baz"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
let c = new C();
|
let c = new C();
|
||||||
assert.sameValue(c[1n](), "baz");
|
assert.sameValue(c["1"](), "baz",
|
||||||
assert.sameValue(c[1](), "baz");
|
"the property name must be the string representation of the numeric value.");
|
||||||
assert.sameValue(c["1"](), "baz");
|
|
||||||
|
|
||||||
// Destructuring
|
// Destructuring
|
||||||
|
|
||||||
let {1n: a} = {1n: "foo"};
|
let { 1n: a } = { "1": "foo" };
|
||||||
assert.sameValue(a, "foo");
|
assert.sameValue(a, "foo",
|
||||||
|
"the property name must be the string representation of the numeric value.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user