MCPcopy Create free account
hub / github.com/dynjs/dynjs / propertyGet

Method propertyGet

src/main/java/org/dynjs/parser/js/Parser.java:355–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

353 }
354
355 protected PropertyGet propertyGet() {
356 try {
357 pushContext(ContextType.FUNCTION);
358 Token get = consume(IDENTIFIER);
359 if (!get.getText().equals("get")) {
360 throw new SyntaxError("expected 'get', was: " + get);
361 }
362
363 Token token = laToken();
364 if (!isPropertyName(token)) {
365 throw new SyntaxError(token, "expected property identifier");
366 }
367 String name = consume().getText();
368 consume(LEFT_PAREN);
369 consume(RIGHT_PAREN);
370 Token position = consume(LEFT_BRACE);
371 BlockStatement body = functionBody();
372 consume(RIGHT_BRACE);
373
374 return new PropertyGet(position, name, body);
375 } finally {
376 popContext();
377 }
378 }
379
380 protected NamedValue namedValue() {
381 Token token = laToken();

Callers 1

objectLiteralMethod · 0.95

Calls 7

pushContextMethod · 0.95
consumeMethod · 0.95
getTextMethod · 0.95
laTokenMethod · 0.95
isPropertyNameMethod · 0.95
functionBodyMethod · 0.95
popContextMethod · 0.95

Tested by

no test coverage detected