MCPcopy Index your code
hub / github.com/Macuyiko/minecraft-python / functionparams

Function functionparams

ServerEditorWeb/ace/worker-javascript.js:4784–4852  ·  view source on GitHub ↗
(fatarrow)

Source from the content-addressed store, hash-verified

4782 }
4783
4784 function functionparams(fatarrow) {
4785 var next;
4786 var params = [];
4787 var ident;
4788 var tokens = [];
4789 var t;
4790 var pastDefault = false;
4791 var loneArg = fatarrow && fatarrow.loneArg;
4792
4793 if (loneArg && loneArg.identifier === true) {
4794 addlabel(loneArg.value, { type: "unused", token: loneArg });
4795 return [loneArg];
4796 }
4797
4798 next = state.tokens.next;
4799
4800 if (!fatarrow || !fatarrow.parsedParen) {
4801 advance("(");
4802 }
4803
4804 if (state.tokens.next.id === ")") {
4805 advance(")");
4806 return;
4807 }
4808
4809 for (;;) {
4810 if (_.contains(["{", "["], state.tokens.next.id)) {
4811 tokens = destructuringExpression();
4812 for (t in tokens) {
4813 t = tokens[t];
4814 if (t.id) {
4815 params.push(t.id);
4816 addlabel(t.id, { type: "unused", token: t.token });
4817 }
4818 }
4819 } else if (state.tokens.next.value === "...") {
4820 if (!state.option.esnext) {
4821 warning("W119", state.tokens.next, "spread/rest operator");
4822 }
4823 advance("...");
4824 ident = identifier(true);
4825 params.push(ident);
4826 addlabel(ident, { type: "unused", token: state.tokens.curr });
4827 } else {
4828 ident = identifier(true);
4829 params.push(ident);
4830 addlabel(ident, { type: "unused", token: state.tokens.curr });
4831 }
4832 if (pastDefault) {
4833 if (state.tokens.next.id !== "=") {
4834 error("E051", state.tokens.current);
4835 }
4836 }
4837 if (state.tokens.next.id === "=") {
4838 if (!state.option.inESNext()) {
4839 warning("W119", state.tokens.next, "default parameters");
4840 }
4841 advance("=");

Callers 1

doFunctionFunction · 0.85

Calls 8

addlabelFunction · 0.85
advanceFunction · 0.85
destructuringExpressionFunction · 0.85
warningFunction · 0.85
identifierFunction · 0.85
expressionFunction · 0.85
commaFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected