Debian Codegraph @

js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-is-subclass.js

raw
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 <[email protected]>
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);