tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

basic-strict.js (1002B)


      1 // Copyright (C) 2025 André Bargull. 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  Basic Iterator.zipkeyed test with "strict" mode.
      8 includes: [compareArray.js, propertyHelper.js, iteratorZipUtils.js]
      9 features: [joint-iteration]
     10 ---*/
     11 
     12 function testSequence(inputs, inputsLabel, minLength, maxLength) {
     13  function test(options, optionsLabel) {
     14    var label = optionsLabel + ", " + inputsLabel;
     15    var it = Iterator.zipKeyed(inputs, options);
     16    assertZippedKeyed(it, inputs, minLength, label);
     17 
     18    if (minLength === maxLength) {
     19      assertIteratorResult(it.next(), undefined, true, label + ": after completion");
     20    } else {
     21      assert.throws(TypeError, function() {
     22        it.next();
     23      }, label + " should throw after " + minLength + " items.");
     24    }
     25  }
     26 
     27  test({ mode: "strict" }, "options = { mode: 'strict' }");
     28 }
     29 
     30 forEachSequenceCombinationKeyed(testSequence);
     31 
     32 reportCompare(0, 0);