update tests to follow review

This commit is contained in:
Toru Nagashima 2020-02-14 21:31:05 +09:00 committed by Rick Waldron
parent 7b1a828459
commit eab9d3bd30
1 changed files with 8 additions and 14 deletions

View File

@ -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.
/*---
@ -33,28 +33,22 @@ let o = { 999999999999999999n: true }; // greater than max safe integer
assert.sameValue(o["999999999999999999"], true,
"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
o = { 1n() { return "bar"; } };
assert.sameValue(o[1n](), "bar");
assert.sameValue(o[1](), "bar");
assert.sameValue(o["1"](), "bar");
assert.sameValue(o["1"](), "bar",
"the property name must be the string representation of the numeric value.");
class C {
1n() { return "baz"; }
}
let c = new C();
assert.sameValue(c[1n](), "baz");
assert.sameValue(c[1](), "baz");
assert.sameValue(c["1"](), "baz");
assert.sameValue(c["1"](), "baz",
"the property name must be the string representation of the numeric value.");
// Destructuring
let {1n: a} = {1n: "foo"};
assert.sameValue(a, "foo");
let { 1n: a } = { "1": "foo" };
assert.sameValue(a, "foo",
"the property name must be the string representation of the numeric value.");