tor-browser

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

AsyncFunction-is-subclass.js (708B)


      1 // Copyright 2016 Microsoft, Inc. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 author: Brian Terlson <brian.terlson@microsoft.com>
      6 esid: sec-async-function-constructor
      7 description: >
      8  %AsyncFunction% is a subclass of Function
      9 ---*/
     10 async function foo() {};
     11 var AsyncFunction = foo.constructor;
     12 assert.sameValue(Object.getPrototypeOf(AsyncFunction), Function, "Prototype of constructor is Function");
     13 assert.sameValue(Object.getPrototypeOf(AsyncFunction.prototype), Function.prototype, "Prototype of constructor's prototype is Function.prototype");
     14 assert(foo instanceof Function, 'async function instance is instanceof Function');
     15 
     16 reportCompare(0, 0);