1
0
Fork 0

load_nasal: fix module and let it return whether there was an error

This commit is contained in:
mfranz 2008-06-14 14:25:34 +00:00
parent a79c0e95c5
commit 62cc0f457c

View file

@ -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