mirror of
https://github.com/tc39/test262.git
synced 2025-05-22 15:50:39 +02:00
After @rwaldron's feedback: The purpose of the `!` operator is to evaluate an UnaryExpression, coerce the result to a boolean value and then return the negated value of that operation. But that's not what you're trying to do at all—you just want to evaluate the expression to the right of the operator, nothing more, nothing less. In this specific case, you don't even really care about the evaluation, the goal is write valid (or invalid, as the case may be) syntax that is will be parsed according to a specific grammar rule that requires some operator to signal that the thing is an expression and not a Block Statement.
21 lines
493 B
JavaScript
21 lines
493 B
JavaScript
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: prod-AsyncMethod
|
|
description: async methods cannot have a line terminator between "async" and the property name
|
|
info: |
|
|
14.6 Async Function Definitions
|
|
|
|
AsyncMethod:
|
|
async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
|
negative:
|
|
phase: early
|
|
type: SyntaxError
|
|
---*/
|
|
|
|
({
|
|
async
|
|
foo() { }
|
|
})
|