mirror of https://github.com/tc39/test262.git
Adding keys during enumeration should not result in their appearance.
Per 9bd1954950
and https://github.com/tc39/test262/pull/453#discussion_r47556411
This commit is contained in:
parent
3dea218911
commit
a9503d5543
|
@ -2,7 +2,7 @@
|
||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: Object.entries sees a new element added by a getter that is hit during iteration
|
description: Object.entries does not see a new element added by a getter that is hit during iteration
|
||||||
es7id: pending
|
es7id: pending
|
||||||
author: Jordan Harband
|
author: Jordan Harband
|
||||||
---*/
|
---*/
|
||||||
|
@ -18,15 +18,12 @@ var bAddsC = {
|
||||||
var result = Object.entries(bAddsC);
|
var result = Object.entries(bAddsC);
|
||||||
|
|
||||||
assert.sameValue(Array.isArray(result), true, 'result is an array');
|
assert.sameValue(Array.isArray(result), true, 'result is an array');
|
||||||
assert.sameValue(result.length, 3, 'result has 3 items');
|
assert.sameValue(result.length, 2, 'result has 2 items');
|
||||||
|
|
||||||
assert.sameValue(Array.isArray(result[0]), true, 'first entry is an array');
|
assert.sameValue(Array.isArray(result[0]), true, 'first entry is an array');
|
||||||
assert.sameValue(Array.isArray(result[1]), true, 'second entry is an array');
|
assert.sameValue(Array.isArray(result[1]), true, 'second entry is an array');
|
||||||
assert.sameValue(Array.isArray(result[2]), true, 'third entry is an array');
|
|
||||||
|
|
||||||
assert.sameValue(result[0][0], 'a', 'first entry has key "a"');
|
assert.sameValue(result[0][0], 'a', 'first entry has key "a"');
|
||||||
assert.sameValue(result[0][1], 'A', 'first entry has value "A"');
|
assert.sameValue(result[0][1], 'A', 'first entry has value "A"');
|
||||||
assert.sameValue(result[1][0], 'b', 'second entry has key "b"');
|
assert.sameValue(result[1][0], 'b', 'second entry has key "b"');
|
||||||
assert.sameValue(result[1][1], 'B', 'second entry has value "B"');
|
assert.sameValue(result[1][1], 'B', 'second entry has value "B"');
|
||||||
assert.sameValue(result[2][0], 'c', 'third entry has key "c"');
|
|
||||||
assert.sameValue(result[2][1], 'C', 'third entry has value "C"');
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: Object.values sees a new element added by a getter that is hit during iteration
|
description: Object.values does not see a new element added by a getter that is hit during iteration
|
||||||
es7id: pending
|
es7id: pending
|
||||||
author: Jordan Harband
|
author: Jordan Harband
|
||||||
---*/
|
---*/
|
||||||
|
@ -18,8 +18,7 @@ var bAddsC = {
|
||||||
var result = Object.values(bAddsC);
|
var result = Object.values(bAddsC);
|
||||||
|
|
||||||
assert.sameValue(Array.isArray(result), true, 'result is an array');
|
assert.sameValue(Array.isArray(result), true, 'result is an array');
|
||||||
assert.sameValue(result.length, 3, 'result has 3 items');
|
assert.sameValue(result.length, 2, 'result has 2 items');
|
||||||
|
|
||||||
assert.sameValue(result[0], 'A', 'first value is "A"');
|
assert.sameValue(result[0], 'A', 'first value is "A"');
|
||||||
assert.sameValue(result[1], 'B', 'second value is "B"');
|
assert.sameValue(result[1], 'B', 'second value is "B"');
|
||||||
assert.sameValue(result[2], 'C', 'third value is "C"');
|
|
||||||
|
|
Loading…
Reference in New Issue