iterables-iteration-inherited.js (708B)
1 // Copyright (C) 2025 Kevin Gibbons. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-iterator.zipkeyed 6 description: > 7 Inherited properties are skipped in "iterables" iteration. 8 includes: [compareArray.js] 9 features: [joint-iteration] 10 ---*/ 11 12 var parent = { 13 get a() { 14 throw new Test262Error("inherited properties should not be examined"); 15 }, 16 } 17 18 var iterables = { 19 __proto__: parent, 20 b: ['value for b'], 21 }; 22 23 var result = Array.from(Iterator.zipKeyed(iterables)); 24 25 assert.sameValue(result.length, 1); 26 assert.compareArray(Object.keys(result[0]), ["b"]); 27 assert.compareArray(Object.values(result[0]), ["value for b"]); 28 29 reportCompare(0, 0);