MCPcopy
hub / github.com/jquery/esprima / parsePropertyMethod

Method parsePropertyMethod

src/parser.ts:742–760  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

740 // https://tc39.github.io/ecma262/#sec-object-initializer
741
742 parsePropertyMethod(params): Node.BlockStatement {
743 this.context.isAssignmentTarget = false;
744 this.context.isBindingElement = false;
745
746 const previousStrict = this.context.strict;
747 const previousAllowStrictDirective = this.context.allowStrictDirective;
748 this.context.allowStrictDirective = params.simple;
749 const body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
750 if (this.context.strict && params.firstRestricted) {
751 this.tolerateUnexpectedToken(params.firstRestricted, params.message);
752 }
753 if (this.context.strict && params.stricted) {
754 this.tolerateUnexpectedToken(params.stricted, params.message);
755 }
756 this.context.strict = previousStrict;
757 this.context.allowStrictDirective = previousAllowStrictDirective;
758
759 return body;
760 }
761
762 parsePropertyMethodFunction(): Node.FunctionExpression {
763 const isGenerator = false;

Callers 5

parseGetterMethodMethod · 0.95
parseSetterMethodMethod · 0.95
parseGeneratorMethodMethod · 0.95

Calls 2

isolateCoverGrammarMethod · 0.95

Tested by

no test coverage detected