Pre-calculate index for module-qualified calls.

This commit is contained in:
Stephen Chung
2020-05-08 22:38:56 +08:00
parent eb52bfa28a
commit e50fcc385f
5 changed files with 63 additions and 42 deletions

View File

@@ -2158,7 +2158,7 @@ let ast = engine.compile(r#"
"#)?;
// Convert the 'AST' into a module, using the 'Engine' to evaluate it first
let module = Module::eval_ast_as_new(&ast, &engine)?;
let module = Module::eval_ast_as_new(Scope::new(), &ast, &engine)?;
// 'module' now can be loaded into a custom 'Scope' for future use. It contains:
// - sub-module: 'extra'