AsyncFunction
BaselineWidely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2017.
AsyncFunction
オブジェクトは、非同期関数のメソッドを提供します。JavaScript では、すべての非同期関数が実際にAsyncFunction
オブジェクトです。
AsyncFunction
はグローバルオブジェクトではないことに注意してください。これは以下のようなコードで取得することができます。
const AsyncFunction = async function () {}.constructor;
AsyncFunction
はFunction
のサブクラスです。
コンストラクター
AsyncFunction()
新しい
AsyncFunction
オブジェクトを生成します。
インスタンスプロパティ
インスタンスプロパティを親であるFunction
から継承しています。
これらのプロパティはAsyncFunction.prototype
で定義されており、すべてのAsyncFunction
のインスタンスで共有されます。
AsyncFunction.prototype.constructor
インスタンスオブジェクトを作成したコンストラクター関数。
AsyncFunction
インスタンスの場合、初期値はAsyncFunction
コンストラクターです。AsyncFunction.prototype[Symbol.toStringTag]
@@toStringTag
プロパティの初期値は、文字列"AsyncFunction"
です。このプロパティはObject.prototype.toString()
で使用されます。
メモ:AsyncFunction
のインスタンスにはprototype
プロパティがありません。
インスタンスメソッド
インスタンスメソッドを親であるFunction
から継承しています。
仕様書
Specification |
---|
ECMAScript® 2026 Language Specification # sec-async-function-objects |