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:
Leo Balter 2017-04-07 11:34:55 -04:00
parent 590d04edd2
commit 6030e4ed71
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B
9 changed files with 18 additions and 18 deletions

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
flags: [onlyStrict]
---*/
!{
({
async foo (arguments) { }
}
})

View File

@ -14,7 +14,7 @@ negative:
type: SyntaxError
---*/
!{
({
async
foo() { }
}
})

View File

@ -9,7 +9,7 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo (x = await) { }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo (await) { }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo () { super() }
}
})

View File

@ -10,6 +10,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(a, a) { }
}
})

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
flags: [onlyStrict]
---*/
!{
({
async foo(eval) { }
}
})

View File

@ -10,6 +10,6 @@ negative:
type: SyntaxError
---*/
!{
({
async function foo(bar) { let bar; }
}
})

View File

@ -9,6 +9,6 @@ negative:
phase: early
type: SyntaxError
---*/
!{
({
async foo(foo = super()) { }
}
})