MCPcopy Index your code
hub / github.com/jquery/esprima / parseYieldExpression

Method parseYieldExpression

src/parser.ts:3141–3161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3139 }
3140
3141 parseYieldExpression(): Node.YieldExpression {
3142 const node = this.createNode();
3143 this.expectKeyword('yield');
3144
3145 let argument: Node.Expression | null = null;
3146 let delegate = false;
3147 if (!this.hasLineTerminator) {
3148 const previousAllowYield = this.context.allowYield;
3149 this.context.allowYield = false;
3150 delegate = this.match('*');
3151 if (delegate) {
3152 this.nextToken();
3153 argument = this.parseAssignmentExpression();
3154 } else if (this.isStartOfExpression()) {
3155 argument = this.parseAssignmentExpression();
3156 }
3157 this.context.allowYield = previousAllowYield;
3158 }
3159
3160 return this.finalize(node, new Node.YieldExpression(argument, delegate));
3161 }
3162
3163 // https://tc39.github.io/ecma262/#sec-class-definitions
3164

Callers 1

Calls 7

createNodeMethod · 0.95
expectKeywordMethod · 0.95
matchMethod · 0.95
nextTokenMethod · 0.95
isStartOfExpressionMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected