private ParseTree parseObjectLiteral ( ) { SourcePosition start = getTreeStartLocation ( ) ; ImmutableList . Builder < ParseTree > result = ImmutableList . builder ( ) ; eat ( TokenType . OPEN_CURLY ) ; Token commaToken = null ; while ( peek ( TokenType . SPREAD ) || peekPropertyNameOrComputedProp ( 0 ) || peek ( TokenType . STAR ) || peekAccessibilityModifier ( ) ) { commaToken = null ; result . add ( parsePropertyAssignment ( ) ) ; commaToken = eatOpt ( TokenType . COMMA ) ; if ( commaToken == null ) { break ; } } eat ( TokenType . CLOSE_CURLY ) ; maybeReportTrailingComma ( commaToken ) ; return new ObjectLiteralExpressionTree ( getTreeLocation ( start ) , result . build ( ) ) ; }
11 . 1 . 4 Object Literal Expression