Propagate source info.

This commit is contained in:
Stephen Chung
2020-12-30 21:12:51 +08:00
parent 386e34aacd
commit ba7f8c6391
9 changed files with 180 additions and 112 deletions

View File

@@ -89,7 +89,7 @@ fn main() {
}
}
let module = match engine
let mut module = match engine
.compile(&contents)
.map_err(|err| err.into())
.and_then(|ast| Module::eval_ast_as_new(Default::default(), &ast, &engine))
@@ -106,6 +106,8 @@ fn main() {
Ok(m) => m,
};
module.set_id(Some(&filename));
engine.register_global_module(module.into());
has_init_scripts = true;