mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Update object literal expressions for readability
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.
This commit is contained in:
parent
590d04edd2
commit
6030e4ed71
@ -10,6 +10,6 @@ negative:
|
||||
type: SyntaxError
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo (arguments) { }
|
||||
}
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ negative:
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
!{
|
||||
({
|
||||
async
|
||||
foo() { }
|
||||
}
|
||||
})
|
||||
|
@ -9,7 +9,7 @@ negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo (x = await) { }
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -9,6 +9,6 @@ negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo (await) { }
|
||||
}
|
||||
})
|
||||
|
@ -9,6 +9,6 @@ negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo () { super() }
|
||||
}
|
||||
})
|
||||
|
@ -10,6 +10,6 @@ negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo(a, a) { }
|
||||
}
|
||||
})
|
||||
|
@ -10,6 +10,6 @@ negative:
|
||||
type: SyntaxError
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo(eval) { }
|
||||
}
|
||||
})
|
||||
|
@ -10,6 +10,6 @@ negative:
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
!{
|
||||
({
|
||||
async function foo(bar) { let bar; }
|
||||
}
|
||||
})
|
||||
|
@ -9,6 +9,6 @@ negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
!{
|
||||
({
|
||||
async foo(foo = super()) { }
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user