mirror of https://github.com/tc39/test262.git
Test computed accessor properties and AggregateError constructor without arguments (#4222)
This commit is contained in:
parent
70cdc562e3
commit
98c7e9114e
|
@ -67,3 +67,7 @@ new AggregateError(case1);
|
||||||
|
|
||||||
assert.sameValue(count, 3);
|
assert.sameValue(count, 3);
|
||||||
assert.compareArray(values, [1, 2]);
|
assert.compareArray(values, [1, 2]);
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
new AggregateError();
|
||||||
|
}, 'GetMethod(obj, @@iterator) returns undefined');
|
||||||
|
|
|
@ -5,9 +5,18 @@ es6id: 12.2.5
|
||||||
description: >
|
description: >
|
||||||
Computed property names for getters
|
Computed property names for getters
|
||||||
---*/
|
---*/
|
||||||
|
var s = Symbol();
|
||||||
var A = {
|
var A = {
|
||||||
get ["a"]() {
|
get ["a"]() {
|
||||||
return "A";
|
return "A";
|
||||||
|
},
|
||||||
|
get [1]() {
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
get [s]() {
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
assert.sameValue(A.a, "A", "The value of `A.a` is `'A'`");
|
assert.sameValue(A.a, "A", "The value of `A.a` is `'A'`");
|
||||||
|
assert.sameValue(A[1], 1, "The value of `A[1]` is `1`");
|
||||||
|
assert.sameValue(A[s], s, "The value of `A[s]` is `Symbol()`");
|
||||||
|
|
|
@ -7,10 +7,19 @@ description: >
|
||||||
that name, whose value is the value of the last property of that name.
|
that name, whose value is the value of the last property of that name.
|
||||||
---*/
|
---*/
|
||||||
var calls = 0;
|
var calls = 0;
|
||||||
|
var s = Symbol();
|
||||||
var A = {
|
var A = {
|
||||||
set ['a'](_) {
|
set ['a'](_) {
|
||||||
calls++;
|
calls++;
|
||||||
|
},
|
||||||
|
set [1](_) {
|
||||||
|
calls++;
|
||||||
|
},
|
||||||
|
set [s](_) {
|
||||||
|
calls++;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
A.a = 'A';
|
A.a = 'A';
|
||||||
assert.sameValue(calls, 1, "The value of `calls` is `1`, after executing `A.a = 'A';`");
|
A[1] = 1;
|
||||||
|
A[s] = s;
|
||||||
|
assert.sameValue(calls, 3, "The value of `calls` is `1`, after executing `A.a = 'A'; A[1] = 1; A[s] = s;`");
|
||||||
|
|
Loading…
Reference in New Issue