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

Function do_function

src/jslint.js:3865–3899  ·  view source on GitHub ↗
(func, name)

Source from the content-addressed store, hash-verified

3863
3864
3865 function do_function(func, name) {
3866 var old_funct = funct,
3867 old_option = option,
3868 old_scope = scope;
3869 funct = {
3870 '(name)' : name || '\'' + (anonname || '').replace(nx, sanitize) + '\'',
3871 '(line)' : next_token.line,
3872 '(context)' : old_funct,
3873 '(breakage)' : 0,
3874 '(loopage)' : 0,
3875 '(scope)' : scope,
3876 '(token)' : func
3877 };
3878 option = Object.create(old_option);
3879 scope = Object.create(old_scope);
3880 functions.push(funct);
3881 func.name = name;
3882 if (name) {
3883 add_label(func, 'function', name);
3884 }
3885 func.writeable = false;
3886 func.first = funct['(params)'] = function_params();
3887 one_space();
3888 func.block = block(false);
3889 if (funct['(arguments)']) {
3890 func.first.forEach(function (value) {
3891 if (value.assign) {
3892 warn('parameter_arguments_a', value, value.string);
3893 }
3894 });
3895 }
3896 funct = old_funct;
3897 option = old_option;
3898 scope = old_scope;
3899 }
3900
3901
3902 assignop('=');

Callers 1

jslint.jsFile · 0.85

Calls 5

add_labelFunction · 0.85
function_paramsFunction · 0.85
one_spaceFunction · 0.85
warnFunction · 0.85
blockFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…