MCPcopy
hub / github.com/eolinker/goku_lite / statement

Function statement

console/static/src/libs/ace-builds/src/worker-javascript.js:4699–4760  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4697 }
4698
4699 function statement() {
4700 var i = indent, r, t = state.tokens.next, hasOwnScope = false;
4701
4702 if (t.id === ";") {
4703 advance(";");
4704 return;
4705 }
4706 var res = isReserved(t);
4707
4708 if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") {
4709 warning("W024", t, t.id);
4710 res = false;
4711 }
4712
4713 if (t.identifier && !res && peek().id === ":") {
4714 advance();
4715 advance(":");
4716
4717 hasOwnScope = true;
4718 state.funct["(scope)"].stack();
4719 state.funct["(scope)"].block.addBreakLabel(t.value, { token: state.tokens.curr });
4720
4721 if (!state.tokens.next.labelled && state.tokens.next.value !== "{") {
4722 warning("W028", state.tokens.next, t.value, state.tokens.next.value);
4723 }
4724
4725 state.tokens.next.label = t.value;
4726 t = state.tokens.next;
4727 }
4728
4729 if (t.id === "{") {
4730 var iscase = (state.funct["(verb)"] === "case" && state.tokens.curr.value === ":");
4731 block(true, true, false, false, iscase);
4732 return;
4733 }
4734
4735 r = expression(0, true);
4736
4737 if (r && !(r.identifier && r.value === "function") &&
4738 !(r.type === "(punctuator)" && r.left &&
4739 r.left.identifier && r.left.value === "function")) {
4740 if (!state.isStrict() &&
4741 state.option.strict === "global") {
4742 warning("E007");
4743 }
4744 }
4745
4746 if (!t.block) {
4747 if (!state.option.expr && (!r || !r.exps)) {
4748 warning("W030", state.tokens.curr);
4749 } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") {
4750 warning("W031", t);
4751 }
4752 parseFinalSemicolon();
4753 }
4754
4755 indent = i;
4756 if (hasOwnScope) {

Callers 3

statementsFunction · 0.85
blockFunction · 0.85

Calls 7

advanceFunction · 0.85
isReservedFunction · 0.85
peekFunction · 0.85
warningFunction · 0.85
blockFunction · 0.85
expressionFunction · 0.85
parseFinalSemicolonFunction · 0.85

Tested by

no test coverage detected