iterables-iteration-symbol-key.js (681B)
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 Symbol properties are used during "iterables" iteration. 8 includes: [compareArray.js] 9 features: [joint-iteration] 10 ---*/ 11 12 var symbolA = Symbol('a'); 13 14 var iterables = { 15 [symbolA]: ['value for a'], 16 b: ['value for b'], 17 }; 18 19 var result = Array.from(Iterator.zipKeyed(iterables)); 20 21 assert.sameValue(result.length, 1); 22 assert.compareArray(Reflect.ownKeys(result[0]), ["b", symbolA]); 23 assert.sameValue(result[0].b, "value for b"); 24 assert.sameValue(result[0][symbolA], "value for a"); 25 26 reportCompare(0, 0);