|
1 |
| -// Copyright (C) 2019 Igalia S.L, Toru Nagashima. All rights reserved. |
| 1 | +// Copyright (C) 2020 Igalia S.L, Toru Nagashima. All rights reserved. |
2 | 2 | // This code is governed by the BSD license found in the LICENSE file.
|
3 | 3 |
|
4 | 4 | /*---
|
@@ -33,28 +33,22 @@ let o = { 999999999999999999n: true }; // greater than max safe integer
|
33 | 33 | assert.sameValue(o["999999999999999999"], true,
|
34 | 34 | "the property name must be the string representation of the numeric value.");
|
35 | 35 |
|
36 |
| -o = { 1n: "foo" }; |
37 |
| -assert.sameValue(o[1n], "foo"); |
38 |
| -assert.sameValue(o[1], "foo"); |
39 |
| -assert.sameValue(o["1"], "foo"); |
40 |
| - |
41 | 36 | // MethodDeclaration
|
42 | 37 |
|
43 | 38 | o = { 1n() { return "bar"; } };
|
44 |
| -assert.sameValue(o[1n](), "bar"); |
45 |
| -assert.sameValue(o[1](), "bar"); |
46 |
| -assert.sameValue(o["1"](), "bar"); |
| 39 | +assert.sameValue(o["1"](), "bar", |
| 40 | + "the property name must be the string representation of the numeric value."); |
47 | 41 |
|
48 | 42 | class C {
|
49 | 43 | 1n() { return "baz"; }
|
50 | 44 | }
|
51 | 45 |
|
52 | 46 | let c = new C();
|
53 |
| -assert.sameValue(c[1n](), "baz"); |
54 |
| -assert.sameValue(c[1](), "baz"); |
55 |
| -assert.sameValue(c["1"](), "baz"); |
| 47 | +assert.sameValue(c["1"](), "baz", |
| 48 | + "the property name must be the string representation of the numeric value."); |
56 | 49 |
|
57 | 50 | // Destructuring
|
58 | 51 |
|
59 |
| -let {1n: a} = {1n: "foo"}; |
60 |
| -assert.sameValue(a, "foo"); |
| 52 | +let { 1n: a } = { "1": "foo" }; |
| 53 | +assert.sameValue(a, "foo", |
| 54 | + "the property name must be the string representation of the numeric value."); |
0 commit comments