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

Method propertySet

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

Source from the content-addressed store, hash-verified

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 {

Callers 1

objectLiteralMethod · 0.95

Calls 8

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

Tested by

no test coverage detected