MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / mozYield

Function mozYield

lib/web/jshint.js:23522–23560  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23520 * expressions.
23521 */
23522 var mozYield = function() {
23523 var prev = state.tokens.prev;
23524 if (state.inES6(true) && !state.funct["(generator)"]) {
23525 // If it's a yield within a catch clause inside a generator then that's ok
23526 if (!("(catch)" === state.funct["(name)"] && state.funct["(context)"]["(generator)"])) {
23527 error("E046", state.tokens.curr, "yield");
23528 }
23529 }
23530 state.funct["(generator)"] = "yielded";
23531 var delegatingYield = false;
23532
23533 if (state.tokens.next.value === "*") {
23534 delegatingYield = true;
23535 advance("*");
23536 }
23537
23538 if (this.line === startLine(state.tokens.next)) {
23539 if (delegatingYield ||
23540 (state.tokens.next.id !== ";" && !state.option.asi &&
23541 !state.tokens.next.reach && state.tokens.next.nud)) {
23542
23543 nobreaknonadjacent(state.tokens.curr, state.tokens.next);
23544 this.first = expression(10);
23545
23546 if (this.first.type === "(punctuator)" && this.first.value === "=" &&
23547 !this.first.paren && !state.option.boss) {
23548 warningAt("W093", this.first.line, this.first.character);
23549 }
23550 }
23551
23552 if (state.tokens.next.id !== ")" &&
23553 (prev.lbp > 30 || (!prev.assign && !isEndOfExpr()) || prev.id === "yield")) {
23554 error("E050", this);
23555 }
23556 } else if (!state.option.asi) {
23557 nolinebreak(this); // always warn (Line breaking error)
23558 }
23559 return this;
23560 };
23561
23562 stmt("throw", function() {
23563 nolinebreak(this);

Callers

nothing calls this directly

Calls 8

errorFunction · 0.85
nobreaknonadjacentFunction · 0.85
warningAtFunction · 0.85
isEndOfExprFunction · 0.85
nolinebreakFunction · 0.85
advanceFunction · 0.70
startLineFunction · 0.70
expressionFunction · 0.70

Tested by

no test coverage detected