self::ACTION_GOTO => self::PAREN_EXPRESSION,
],
],
+ // Property assignment - This is an object literal declaration.
+ // For example: `{ key: value }`
self::PROPERTY_ASSIGNMENT => [
self::TYPE_COLON => [
self::ACTION_GOTO => self::PROPERTY_EXPRESSION,
self::ACTION_GOTO => self::STATEMENT,
],
],
+ // Property expression - The value of a key in an object literal.
self::PROPERTY_EXPRESSION => [
self::TYPE_BRACE_OPEN => [
self::ACTION_PUSH => self::PROPERTY_EXPRESSION_OP,
self::ACTION_GOTO => self::PROPERTY_EXPRESSION,
],
self::TYPE_HOOK => [
- self::ACTION_GOTO => self::PROPERTY_EXPRESSION,
+ self::ACTION_PUSH => self::PROPERTY_EXPRESSION,
+ self::ACTION_GOTO => self::EXPRESSION_TERNARY,
],
self::TYPE_COMMA => [
self::ACTION_GOTO => self::PROPERTY_ASSIGNMENT,
[
// Regression test for T201606.
// Must not break between 'return' and Expression.
- // FIXME: Cause?
+ // Was caused by bad state after a ternary in the expression value
+ // for a key in an object literal.
<<<JAVASCRIPT
call( {
key: 1 ? 0 : function () {
'(',
')',
'{',
- 'return', 'this', // FIXME
+ 'return this',
';',
'}',
'}',