MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / statement

Function statement

src/cm/javascript.js:245–262  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

243 }
244
245 function statement(type) {
246 if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
247 if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
248 if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
249 if (type == "{") return cont(pushlex("}"), block, poplex);
250 if (type == ";") return cont();
251 if (type == "function") return cont(functiondef);
252 if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
253 poplex, statement, poplex);
254 if (type == "variable") return cont(pushlex("stat"), maybelabel);
255 if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
256 block, poplex, poplex);
257 if (type == "case") return cont(expression, expect(":"));
258 if (type == "default") return cont(expect(":"));
259 if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
260 statement, poplex, popcontext);
261 return pass(pushlex("stat"), expression, expect(";"), poplex);
262 }
263 function expression(type) {
264 if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
265 if (type == "function") return cont(functiondef);

Callers

nothing calls this directly

Calls 4

contFunction · 0.85
pushlexFunction · 0.85
expectFunction · 0.85
passFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…