Skip to content

[BUG] wasmoon doString can not get lua traceback #140

Description

@challen03

lua doStringSync can get lua traceback

lua.doStringSync(`
        local a = 1

        local throw_error = function()
            error('test error')
        end


        -- throw_error()

        -- local ret = pcall(throw_error, a)
        local throw_error_wrap = function()
            throw_error()
        end

        print('before throw_error_wrap')
        throw_error_wrap()
        print('after throw_error_wrap')

result:

Error: [string "..."]:5: test error
stack traceback:
        [string "..."]:5: in upvalue 'throw_error'
        [string "..."]:13: in local 'throw_error_wrap'
        [string "..."]:17: in main chunk

but use doString api, can not get lua traceback, only get error line

lua.doString(`
        local a = 1

        local throw_error = function()
            error('test error')
        end


        -- throw_error()

        -- local ret = pcall(throw_error, a)
        local throw_error_wrap = function()
            throw_error()
        end

        print('before throw_error_wrap')
        throw_error_wrap()
        print('after throw_error_wrap')

result:

error Error: [string "..."]:5: test error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions