Skip to content

Does not work error function in a loaded file by using dofile. #67

@kohkimakimoto

Description

@kohkimakimoto

I tested the following 2 files code by using glua.

a.lua

dofile "b.lua"

b.lua

error("error!")

Run the command. Got a incorrect message: nil as the following.

$ glua a.lua
nil
stack traceback:
    [G]: in error
    b.lua:1: in <b.lua:0>
    [G]: in dofile
    a.lua:1: in function 'main chunk'
    [G]: ?

And I also tested running the original C lua5.1 in the same way. Got a correct error message.

$ lua5.1 a.lua
lua5.1: b.lua:1: error!
stack traceback:
    [C]: in function 'error'
    b.lua:1: in main chunk
    [C]: in function 'dofile'
    a.lua:1: in main chunk
    [C]: ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions