tor-browser

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

thisarg-omitted-strict-strict.js (907B)


      1 // |reftest| async
      2 'use strict';
      3 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
      4 // This code is governed by the BSD license found in the LICENSE file.
      5 
      6 /*---
      7 esid: sec-array.fromasync
      8 description: >
      9  If thisArg is omitted, mapfn is called with undefined as the this-value in
     10  strict mode
     11 info: |
     12  6. If _mapping_ is *true*, then
     13    a. Let _mappedValue_ be Call(_mapfn_, _thisArg_, « _nextValue_, 𝔽(_k_) »).
     14 
     15  In OrdinaryCallBindThis, _thisArgument_ is always bound as the this-value in
     16  strict mode (_F_.[[ThisMode]] is ~strict~, where _F_ is the function object.)
     17 flags: [async, onlyStrict]
     18 includes: [asyncHelpers.js]
     19 features: [Array.fromAsync]
     20 ---*/
     21 
     22 asyncTest(async () => {
     23  await Array.fromAsync([1, 2, 3], async function () {
     24    assert.sameValue(
     25      this,
     26      undefined,
     27      "undefined should be bound as the this-value of mapfn when thisArg is omitted"
     28    );
     29  });
     30 });