| 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('='); |