load_nasal: fix module and let it return whether there was an error
This commit is contained in:
parent
a79c0e95c5
commit
62cc0f457c
1 changed files with 3 additions and 2 deletions
|
@ -46,12 +46,13 @@ var load_nasal = func(file, module = nil) {
|
|||
|
||||
var err = [];
|
||||
printlog("info", "loading ", file, " into namespace ", module);
|
||||
var code = call(func compile(io.readfile(file), file), nil, err);
|
||||
var code = call(func compile(readfile(file), file), nil, err);
|
||||
if(size(err))
|
||||
return print(file ~ ": " ~ err[0]);
|
||||
|
||||
call(bind(code, globals), nil, nil, globals[module], err);
|
||||
printerror(err);
|
||||
debug.printerror(err);
|
||||
return size(err);
|
||||
}
|
||||
|
||||
# The following two functions are for reading generic XML files into
|
||||
|
|
Loading…
Add table
Reference in a new issue