node: fix panic in explode/implode parameter reordering
This commit is contained in:
parent
b2ef112f50
commit
1188a769ce
4
node.go
4
node.go
@ -1010,7 +1010,7 @@ func (this *conversionState) convertNoFreeFloating(n_ node.Node) (string, error)
|
||||
}
|
||||
this.importPackages["strings"] = struct{}{}
|
||||
funcName = `strings.Split`
|
||||
callParams[0], callParams[1] = callParams[1], callParams[2] // need to reverse function argument order
|
||||
callParams[0], callParams[1] = callParams[1], callParams[0] // need to reverse function argument order
|
||||
|
||||
} else if funcName == `implode` {
|
||||
if len(callParams) != 2 {
|
||||
@ -1019,7 +1019,7 @@ func (this *conversionState) convertNoFreeFloating(n_ node.Node) (string, error)
|
||||
|
||||
this.importPackages["strings"] = struct{}{}
|
||||
funcName = `strings.Join`
|
||||
callParams[0], callParams[1] = callParams[1], callParams[2] // need to reverse function argument order
|
||||
callParams[0], callParams[1] = callParams[1], callParams[0] // need to reverse function argument order
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user