compiler: support delete() builtin

This commit is contained in:
Evgenii Stratonikov 2020-09-06 15:49:41 +03:00
parent 18369c489e
commit 7483e3b054
3 changed files with 23 additions and 1 deletions

View file

@ -1527,6 +1527,8 @@ func (c *codegen) convertBuiltin(expr *ast.CallExpr) {
}
emit.Opcode(c.prog.BinWriter, opcode.PUSHNULL)
c.emitStoreByIndex(varGlobal, c.exceptionIndex)
case "delete":
emit.Opcode(c.prog.BinWriter, opcode.REMOVE)
case "ToInteger", "ToByteArray", "ToBool":
typ := stackitem.IntegerT
switch name {