Skip to content

Commit 4c2ca95

Browse files
committed
v2.eval: fix tests
1 parent c4d051b commit 4c2ca95

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

cmd/tools/git_pre_commit_hook.vsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn main() {
6262
}
6363
// vfmt on
6464
all_vfiles_on_a_line := vfiles.map(os.quoted_path(it)).join(' ')
65-
os.system('v fmt -w ${all_vfiles_on_a_line}')
65+
os.system('${os.quoted_path(@VEXE)} fmt -w ${all_vfiles_on_a_line}')
6666
os.system('git add ${all_vfiles_on_a_line}')
6767
}
6868
}

vlib/v2/eval/eval.v

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5105,6 +5105,12 @@ fn (mut e Eval) call_array_method(receiver ArrayValue, method_name string, args
51055105
'has' {
51065106
return e.array_has(receiver, safe_arg(args, 0))
51075107
}
5108+
'clone' {
5109+
return ArrayValue{
5110+
elem_type_name: receiver.elem_type_name
5111+
values: receiver.values.clone()
5112+
}
5113+
}
51085114
'contains' {
51095115
return e.array_contains(receiver, safe_arg(args, 0))
51105116
}

0 commit comments

Comments
 (0)