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

Method isolateCoverGrammar

src/parser.ts:548–567  ·  view source on GitHub ↗
(parseFunction)

Source from the content-addressed store, hash-verified

546 // pattern. The CoverInitializedName check is deferred.
547
548 isolateCoverGrammar(parseFunction) {
549 const previousIsBindingElement = this.context.isBindingElement;
550 const previousIsAssignmentTarget = this.context.isAssignmentTarget;
551 const previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
552
553 this.context.isBindingElement = true;
554 this.context.isAssignmentTarget = true;
555 this.context.firstCoverInitializedNameError = null;
556
557 const result = parseFunction.call(this);
558 if (this.context.firstCoverInitializedNameError !== null) {
559 this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
560 }
561
562 this.context.isBindingElement = previousIsBindingElement;
563 this.context.isAssignmentTarget = previousIsAssignmentTarget;
564 this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
565
566 return result;
567 }
568
569 inheritCoverGrammar(parseFunction) {
570 const previousIsBindingElement = this.context.isBindingElement;

Calls 1

throwUnexpectedTokenMethod · 0.95

Tested by

no test coverage detected