| // 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); |