using-for-using-of-of.js (921B)
1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) -- explicit-resource-management is not enabled unconditionally, requires shell-options 2 // Copyright (C) 2023 Ron Buckton. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-for-in-and-for-of-statements 6 description: > 7 using: 'for (using of' is always interpreted as identifier 8 features: [explicit-resource-management] 9 ---*/ 10 11 var using, of = [[9], [8], [7]], result = []; 12 for (using of of [0, 1, 2]) { 13 // ^^^^^ ^^^^^^^^^^^^ 14 // | | 15 // | interpreted as element access `of[2]` 16 // | 17 // interpreted as identifier named `using` 18 19 result.push(using); 20 } 21 22 assert.sameValue(result.length, 1); 23 assert.sameValue(result[0], 7); 24 25 reportCompare(0, 0);