blob: 99f23261c7f859ce9325c44d2ad840126d1cee7b [file] [edit]
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/statements/class/elements/async-private-method/
name: Async private method as a ClassDeclaration element
esid: prod-AsyncMethod
info: |
ClassElement :
PrivateMethodDefinition
MethodDefinition :
AsyncMethod
Async Function Definitions
AsyncMethod :
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
features: [async-functions, class-methods-private]
---*/
class C {
async #method(/*{ params }*/) {
/*{ body }*/
}
async method(/*{ params }*/) {
return this.#method(/*{ params }*/);
}
}
// Stores a reference `asyncFn` for case evaluation
let c = new C();
let asyncFn = c.method.bind(c);