vm: implement ASSERT/ABORT opcodes
Rename THROWIFNOT to ASSERT, add ABORT opcode. ABORT cannot be caught, but the implementation should be postponed until exception handling is implemented.
This commit is contained in:
parent
963a70d54a
commit
977c431bf1
9 changed files with 104 additions and 98 deletions
|
@ -9,10 +9,10 @@ import (
|
|||
// Nothing more to test here, really.
|
||||
func TestStringer(t *testing.T) {
|
||||
tests := map[Opcode]string{
|
||||
ADD: "ADD",
|
||||
SUB: "SUB",
|
||||
THROWIFNOT: "THROWIFNOT",
|
||||
0xff: "Opcode(255)",
|
||||
ADD: "ADD",
|
||||
SUB: "SUB",
|
||||
ASSERT: "ASSERT",
|
||||
0xff: "Opcode(255)",
|
||||
}
|
||||
for o, s := range tests {
|
||||
assert.Equal(t, s, o.String())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue