blob: 100aacd0fe72c21cdbe5c6de76f9dbac15f3da57 [file] [log] [blame] [edit]
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/elements/async-private-method/
name: Async private method as a ClassExpression 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]
---*/
var C = class {
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);