pkg/proc: do not check decl line for FunctionArguments (#3254)

Fixes a bug where we cannot get locals (including arguments and return
values) from a given scope because the line number state machine ends up
in an invalid state because of this parameter being set to false.
This commit is contained in:
Derek Parker
2023-01-24 06:56:05 -08:00
committed by GitHub
parent 2be9cf1fab
commit a01fe73845
3 changed files with 39 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func (scope *EvalScope) LocalVariables(cfg LoadConfig) ([]*Variable, error) {
// FunctionArguments returns the name, value, and type of all current function arguments.
func (scope *EvalScope) FunctionArguments(cfg LoadConfig) ([]*Variable, error) {
vars, err := scope.Locals(0)
vars, err := scope.Locals(localsNoDeclLineCheck)
if err != nil {
return nil, err
}