Skip to content

Commit 65d49e6

Browse files
committed
fix: Remove 'eval' for 'declare'
1 parent 1626e37 commit 65d49e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/lib/traverse-set.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,15 @@ bash_object.traverse-set() {
222222
return
223223
fi
224224

225-
if ! eval "declare -gA $global_object_name=()"; then
225+
if ! declare -gA "$global_object_name"; then
226226
bash_object.util.die 'ERROR_INTERNAL' 'Eval declare failed'
227227
return
228228
fi
229+
local -n global_object="$global_object_name"
230+
global_object=()
229231

230232
current_object["$key"]=$'\x1C\x1D'"type=object;&$global_object_name"
231233

232-
local -n global_object="$global_object_name"
233234
local -n object_to_copy_from="$final_value"
234235

235236
for key in "${!object_to_copy_from[@]}"; do

0 commit comments

Comments
 (0)