vm: stringify InteropInterface stackitem type as InteropInterface
This commit is contained in:
parent
84629b0760
commit
a3285eae04
5 changed files with 7 additions and 7 deletions
|
@ -910,7 +910,7 @@ func (i *Interop) Value() interface{} {
|
|||
|
||||
// String implements stringer interface.
|
||||
func (i *Interop) String() string {
|
||||
return "Interop"
|
||||
return "InteropInterface"
|
||||
}
|
||||
|
||||
// Dup implements the Item interface.
|
||||
|
|
|
@ -126,7 +126,7 @@ var stringerTestCases = []struct {
|
|||
},
|
||||
{
|
||||
input: NewInterop(nil),
|
||||
result: "Interop",
|
||||
result: "InteropInterface",
|
||||
},
|
||||
{
|
||||
input: NewPointer(0, nil),
|
||||
|
|
|
@ -299,7 +299,7 @@ func toJSONWithTypes(data []byte, item Item, seen map[Item]sliceNoPointer) ([]by
|
|||
case Null:
|
||||
val = `{"type":"Any"}`
|
||||
case *Interop:
|
||||
val = `{"type":"Interop"}`
|
||||
val = `{"type":"InteropInterface"}`
|
||||
default:
|
||||
val = `{"type":"` + item.Type().String() + `","value":`
|
||||
hasValue = true
|
||||
|
|
|
@ -235,7 +235,7 @@ func TestToJSONWithTypes(t *testing.T) {
|
|||
`{"type":"Map","value":[{"key":{"type":"Integer","value":"42"},` +
|
||||
`"value":{"type":"Boolean","value":false}}]}`},
|
||||
{"Interop", NewInterop(nil),
|
||||
`{"type":"Interop"}`},
|
||||
`{"type":"InteropInterface"}`},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
@ -385,7 +385,7 @@ func TestFromJSONWithTypes(t *testing.T) {
|
|||
item Item
|
||||
}{
|
||||
{"Pointer", `{"type":"Pointer","value":3}`, NewPointer(3, nil)},
|
||||
{"Interop", `{"type":"Interop"}`, NewInterop(nil)},
|
||||
{"Interop", `{"type":"InteropInterface"}`, NewInterop(nil)},
|
||||
{"Null", `{"type":"Any"}`, Null{}},
|
||||
{"Array", `{"type":"Array","value":[{"type":"Any"}]}`, NewArray([]Item{Null{}})},
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func (t Type) String() string {
|
|||
case MapT:
|
||||
return "Map"
|
||||
case InteropT:
|
||||
return "Interop"
|
||||
return "InteropInterface"
|
||||
default:
|
||||
return "INVALID"
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ func FromString(s string) (Type, error) {
|
|||
return StructT, nil
|
||||
case "Map":
|
||||
return MapT, nil
|
||||
case "Interop":
|
||||
case "InteropInterface":
|
||||
return InteropT, nil
|
||||
default:
|
||||
return 0xFF, ErrInvalidType
|
||||
|
|
Loading…
Reference in a new issue