You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You must post issues only here. Questions, ideas must be posted in discussions.
GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.
Please answer the following before submitting your issue:
What version of GopherLua are you using? : 2b3f02d
What version of Go are you using? : go version go1.19.12 linux/amd64
What operating system and processor architecture are you using? : See 2.
What did you do? :
What did you expect to see? : xpcall with error in error handler returns (false, error-object).
/ # lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> ok, msg = xpcall(function() error("fn") end, function(err) error("handler") end)
> print(ok, msg)
false error in error handling
>functiontest()>>xpcall(function() error("fn") end, function(err) error("handler") end)
>> error("expected to reach this")
>> end
>test()
stdin:3: expected to reach this
stack traceback:
[C]: infunction'error'
stdin:3: infunction'test'
stdin:1: in main chunk
[C]: ?>
What did you see instead? : xpcall with error in error handler returns (nil, nil).
In addition, xpcall exits current function scope and interpreter does not execute next line.
Although the behavior of xpcall with error in error handler is not well described in the reference, but it is better to be compatible with CLua5.1 behavior.
The text was updated successfully, but these errors were encountered:
mzki
added a commit
to mzki/gopher-lua
that referenced
this issue
Aug 12, 2023
You must post issues only here. Questions, ideas must be posted in discussions.
Please answer the following before submitting your issue:
go version go1.19.12 linux/amd64
xpcall
with error in error handler returns(false, error-object)
.xpcall
with error in error handler returns(nil, nil)
.In addition,
xpcall
exits current function scope and interpreter does not execute next line.Although the behavior of
xpcall
with error in error handler is not well described in the reference, but it is better to be compatible with CLua5.1 behavior.The text was updated successfully, but these errors were encountered: