experimental: removes Parameters API from StackIterator (#1716)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
@@ -1195,11 +1195,6 @@ func (si *stackIterator) Function() experimental.InternalFunction {
|
||||
return internalFunction{si.fn}
|
||||
}
|
||||
|
||||
// Parameters implements the same method as documented on experimental.StackIterator.
|
||||
func (si *stackIterator) Parameters() []uint64 {
|
||||
return si.stack[si.base : si.base+si.fn.funcType.ParamNumInUint64]
|
||||
}
|
||||
|
||||
// internalFunction implements experimental.InternalFunction.
|
||||
type internalFunction struct{ *function }
|
||||
|
||||
|
||||
@@ -436,14 +436,13 @@ func Test_callFrameOffset(t *testing.T) {
|
||||
}
|
||||
|
||||
type stackEntry struct {
|
||||
def api.FunctionDefinition
|
||||
args []uint64
|
||||
def api.FunctionDefinition
|
||||
}
|
||||
|
||||
func assertStackIterator(t *testing.T, it experimental.StackIterator, expected []stackEntry) {
|
||||
var actual []stackEntry
|
||||
for it.Next() {
|
||||
actual = append(actual, stackEntry{def: it.Function().Definition(), args: it.Parameters()})
|
||||
actual = append(actual, stackEntry{def: it.Function().Definition()})
|
||||
}
|
||||
require.Equal(t, expected, actual)
|
||||
}
|
||||
@@ -458,7 +457,7 @@ func TestCallEngine_builtinFunctionFunctionListenerBefore(t *testing.T) {
|
||||
before: func(ctx context.Context, _ api.Module, def api.FunctionDefinition, params []uint64, stackIterator experimental.StackIterator) {
|
||||
require.Equal(t, currentContext, ctx)
|
||||
require.Equal(t, []uint64{2, 3, 4}, params)
|
||||
assertStackIterator(t, stackIterator, []stackEntry{{def: def, args: []uint64{2, 3, 4}}})
|
||||
assertStackIterator(t, stackIterator, []stackEntry{{def: def}})
|
||||
},
|
||||
},
|
||||
index: 0,
|
||||
|
||||
Reference in New Issue
Block a user