mirror of
https://github.com/tc39/test262.git
synced 2025-11-29 18:13:13 +01:00
28 lines
686 B
JavaScript
28 lines
686 B
JavaScript
// Copyright (C) 2025 Kevin Gibbons. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-iterator.zipkeyed
|
|
description: >
|
|
Inherited properties are skipped in "iterables" iteration.
|
|
includes: [compareArray.js]
|
|
features: [joint-iteration]
|
|
---*/
|
|
|
|
var parent = {
|
|
get a() {
|
|
throw new Test262Error("inherited properties should not be examined");
|
|
},
|
|
}
|
|
|
|
var iterables = {
|
|
__proto__: parent,
|
|
b: ['value for b'],
|
|
};
|
|
|
|
var result = Array.from(Iterator.zipKeyed(iterables));
|
|
|
|
assert.sameValue(result.length, 1);
|
|
assert.compareArray(Object.keys(result[0]), ["b"]);
|
|
assert.compareArray(Object.values(result[0]), ["value for b"]);
|