MCPcopy
hub / github.com/Tampermonkey/tampermonkey / block

Function block

src/jslint.js:2996–3035  ·  view source on GitHub ↗
(ordinary)

Source from the content-addressed store, hash-verified

2994
2995
2996 function block(ordinary) {
2997
2998// array block is array sequence of statements wrapped in braces.
2999// ordinary is false for function bodies and try blocks.
3000// ordinary is true for if statements, while, etc.
3001
3002 var array,
3003 curly = next_token,
3004 old_in_block = in_block,
3005 old_scope = scope,
3006 old_strict_mode = strict_mode;
3007
3008 in_block = ordinary;
3009 scope = Object.create(scope);
3010 spaces();
3011 if (next_token.id === '{') {
3012 advance('{');
3013 step_in();
3014 if (!ordinary && !use_strict() && !old_strict_mode &&
3015 !option.sloppy && funct['(context)'] === global_funct) {
3016 warn('missing_use_strict');
3017 }
3018 array = statements();
3019 strict_mode = old_strict_mode;
3020 step_out('}', curly);
3021 } else if (!ordinary) {
3022 stop('expected_a_b', next_token, '{', artifact());
3023 } else {
3024 warn('expected_a_b', next_token, '{', artifact());
3025 array = [statement()];
3026 array.disrupt = array[0].disrupt;
3027 }
3028 funct['(verb)'] = null;
3029 scope = old_scope;
3030 in_block = old_in_block;
3031 if (ordinary && array.length === 0) {
3032 warn('empty_block');
3033 }
3034 return array;
3035 }
3036
3037
3038 function tally_property(name) {

Callers 2

do_functionFunction · 0.70
jslint.jsFile · 0.70

Calls 10

spacesFunction · 0.85
advanceFunction · 0.85
step_inFunction · 0.85
use_strictFunction · 0.85
warnFunction · 0.85
statementsFunction · 0.85
step_outFunction · 0.85
artifactFunction · 0.85
stopFunction · 0.70
statementFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…