Add Dynamic::NULL to simplify this pointer binding.

This commit is contained in:
Stephen Chung
2022-11-08 16:16:42 +08:00
parent 6053aa1641
commit 8f128f37f0
16 changed files with 126 additions and 77 deletions

View File

@@ -250,7 +250,9 @@ impl Engine {
) -> RhaiResult {
let statements = ast.statements();
let lib = &[AsRef::<SharedModule>::as_ref(ast).clone()];
let mut this_ptr = this_ptr;
let mut no_this_ptr = Dynamic::NULL;
let mut this_ptr = this_ptr.unwrap_or(&mut no_this_ptr);
let orig_scope_len = scope.len();