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

Function block

console/static/src/libs/ace-builds/src/worker-javascript.js:4824–4949  ·  view source on GitHub ↗
(ordinary, stmt, isfunc, isfatarrow, iscase)

Source from the content-addressed store, hash-verified

4822 }
4823 }
4824 function block(ordinary, stmt, isfunc, isfatarrow, iscase) {
4825 var a,
4826 b = inblock,
4827 old_indent = indent,
4828 m,
4829 t,
4830 line,
4831 d;
4832
4833 inblock = ordinary;
4834
4835 t = state.tokens.next;
4836
4837 var metrics = state.funct["(metrics)"];
4838 metrics.nestedBlockDepth += 1;
4839 metrics.verifyMaxNestedBlockDepthPerFunction();
4840
4841 if (state.tokens.next.id === "{") {
4842 advance("{");
4843 state.funct["(scope)"].stack();
4844
4845 line = state.tokens.curr.line;
4846 if (state.tokens.next.id !== "}") {
4847 indent += state.option.indent;
4848 while (!ordinary && state.tokens.next.from > indent) {
4849 indent += state.option.indent;
4850 }
4851
4852 if (isfunc) {
4853 m = {};
4854 for (d in state.directive) {
4855 if (_.has(state.directive, d)) {
4856 m[d] = state.directive[d];
4857 }
4858 }
4859 directives();
4860
4861 if (state.option.strict && state.funct["(context)"]["(global)"]) {
4862 if (!m["use strict"] && !state.isStrict()) {
4863 warning("E007");
4864 }
4865 }
4866 }
4867
4868 a = statements();
4869
4870 metrics.statementCount += a.length;
4871
4872 indent -= state.option.indent;
4873 }
4874
4875 advance("}", t);
4876
4877 if (isfunc) {
4878 state.funct["(scope)"].validateParams();
4879 if (m) {
4880 state.directive = m;
4881 }

Callers 5

statementFunction · 0.85
doFunctionFunction · 0.85
blockVariableStatementFunction · 0.85
doCatchFunction · 0.85

Calls 7

advanceFunction · 0.85
directivesFunction · 0.85
warningFunction · 0.85
statementsFunction · 0.85
errorFunction · 0.85
expressionFunction · 0.85
statementFunction · 0.85

Tested by

no test coverage detected