()
| 322 | } |
| 323 | |
| 324 | protected PropertySet propertySet() { |
| 325 | try { |
| 326 | pushContext(ContextType.FUNCTION); |
| 327 | Token set = consume(IDENTIFIER); |
| 328 | if (!set.getText().equals("set")) { |
| 329 | throw new SyntaxError("expected 'set', was: " + set); |
| 330 | } |
| 331 | |
| 332 | Token token = laToken(); |
| 333 | if (!isPropertyName(token)) { |
| 334 | throw new SyntaxError(token, "expected property identifier"); |
| 335 | } |
| 336 | |
| 337 | String name = consume().getText(); |
| 338 | consume(LEFT_PAREN); |
| 339 | |
| 340 | Token param = consume(IDENTIFIER); |
| 341 | if (!isAssignableName(param.getText())) { |
| 342 | throw new SyntaxError("invalid parameter name: " + param.getText()); |
| 343 | } |
| 344 | consume(RIGHT_PAREN); |
| 345 | Token position = consume(LEFT_BRACE); |
| 346 | BlockStatement body = functionBody(); |
| 347 | consume(RIGHT_BRACE); |
| 348 | |
| 349 | return new PropertySet(position, name, param.getText(), body); |
| 350 | } finally { |
| 351 | popContext(); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | protected PropertyGet propertyGet() { |
| 356 | try { |
no test coverage detected