tor-browser

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

invoked-as-function-no-arguments.js (732B)


      1 // |reftest| async
      2 // Copyright (C) 2018 Valerie Young. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 esid: sec-asyncgeneratorfunction
      6 description: >
      7    When invoked via the function invocation pattern without arguments, the
      8    AsyncGeneratorFunction intrinsic returns a valid generator with an empty body.
      9 features: [async-iteration]
     10 flags: [async]
     11 ---*/
     12 
     13 var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
     14 
     15 var g = AsyncGeneratorFunction();
     16 var iter = g();
     17 
     18 iter.next().then(function(result) {
     19  assert.sameValue(result.value, undefined, 'Result `value`');
     20  assert.sameValue(result.done, true, 'Result `done` flag');
     21 }).then($DONE, $DONE)