Add Dynamic::NULL to simplify this pointer binding.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
@@ -198,8 +198,10 @@ impl Engine {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
AsRef::<crate::SharedModule>::as_ref(ast).clone(),
|
||||
];
|
||||
let mut this = Dynamic::NULL;
|
||||
let node = &crate::ast::Stmt::Noop(Position::NONE);
|
||||
self.run_debugger(global, caches, lib, 0, scope, &mut None, node)?;
|
||||
|
||||
self.run_debugger(global, caches, lib, 0, scope, &mut this, node)?;
|
||||
}
|
||||
|
||||
let typ = self.map_type_name(result.type_name());
|
||||
|
@@ -141,8 +141,9 @@ impl Engine {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
AsRef::<crate::SharedModule>::as_ref(ast).clone(),
|
||||
];
|
||||
let mut this = crate::Dynamic::NULL;
|
||||
let node = &crate::ast::Stmt::Noop(crate::Position::NONE);
|
||||
self.run_debugger(global, caches, lib, 0, scope, &mut None, node)?;
|
||||
self.run_debugger(global, caches, lib, 0, scope, &mut this, node)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user