vm: drop LoadArgs method, it's a Legacy remnant

This commit is contained in:
Roman Khimov 2021-11-19 22:25:14 +03:00
parent cd3670a199
commit b0a8f54776
2 changed files with 6 additions and 11 deletions

View file

@ -42,7 +42,12 @@ func eval(t *testing.T, src string, result interface{}) {
func evalWithArgs(t *testing.T, src string, op []byte, args []stackitem.Item, result interface{}) {
vm := vmAndCompile(t, src)
vm.LoadArgs(op, args)
if len(args) > 0 {
vm.Estack().PushVal(args)
}
if op != nil {
vm.Estack().PushVal(op)
}
err := vm.Run()
require.NoError(t, err)
assert.Equal(t, 1, vm.Estack().Len(), "stack contains unexpected items")

View file

@ -133,16 +133,6 @@ func (v *VM) Istack() *Stack {
return &v.istack
}
// LoadArgs loads in the arguments used in the Mian entry point.
func (v *VM) LoadArgs(method []byte, args []stackitem.Item) {
if len(args) > 0 {
v.estack.PushVal(args)
}
if method != nil {
v.estack.PushVal(method)
}
}
// PrintOps prints the opcodes of the current loaded program to stdout.
func (v *VM) PrintOps(out io.Writer) {
if out == nil {