We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78f9a17 commit 5105462Copy full SHA for 5105462
bit/api.go
@@ -23,13 +23,14 @@ const (
23
func Bitwise(kind op) lua.LGFunction {
24
return func(l *lua.LState) int {
25
if kind > rs {
26
- l.Push(lua.LString("invalid type of operation"))
27
- return 1
+ l.RaiseError("unsupported operation type")
+ return 0
28
}
29
val1, val2, err := prepareParams(l)
30
if err != nil {
31
+ l.Push(lua.LNil)
32
l.Push(lua.LString(err.Error()))
33
+ return 2
34
35
var ret uint32
36
switch kind {
@@ -53,6 +54,7 @@ func Bitwise(kind op) lua.LGFunction {
53
54
func Not(l *lua.LState) int {
55
val, err := intToU32(l.CheckInt(1))
56
57
58
59
return 1
60
0 commit comments