Fix position of function calls.
This commit is contained in:
parent
bd9519e96b
commit
556b2393f5
@ -271,7 +271,7 @@ fn main() {
|
||||
}
|
||||
DebuggerEvent::FunctionExitWithValue(r) => {
|
||||
println!(
|
||||
"! Return from function call '{}' => {}",
|
||||
"! Return from function call '{}' => {:?}",
|
||||
context
|
||||
.global_runtime_state()
|
||||
.debugger
|
||||
|
@ -270,7 +270,7 @@ impl Engine {
|
||||
|
||||
// Function calls should account for a relatively larger portion of expressions because
|
||||
// binary operators are also function calls.
|
||||
if let Expr::FnCall(x, pos) = expr {
|
||||
if let Expr::FnCall(x, _) = expr {
|
||||
#[cfg(feature = "debugging")]
|
||||
let reset_debugger =
|
||||
self.run_debugger_with_reset(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
@ -279,7 +279,7 @@ impl Engine {
|
||||
self.inc_operations(&mut global.num_operations, expr.position())?;
|
||||
|
||||
let result =
|
||||
self.eval_fn_call_expr(scope, global, state, lib, this_ptr, x, *pos, level);
|
||||
self.eval_fn_call_expr(scope, global, state, lib, this_ptr, x, x.pos, level);
|
||||
|
||||
#[cfg(feature = "debugging")]
|
||||
global.debugger.reset_status(reset_debugger);
|
||||
|
@ -211,12 +211,12 @@ impl Engine {
|
||||
// Popular branches are lifted out of the `match` statement into their own branches.
|
||||
|
||||
// Function calls should account for a relatively larger portion of statements.
|
||||
if let Stmt::FnCall(x, pos) = stmt {
|
||||
if let Stmt::FnCall(x, _) = stmt {
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
self.inc_operations(&mut global.num_operations, stmt.position())?;
|
||||
|
||||
let result =
|
||||
self.eval_fn_call_expr(scope, global, state, lib, this_ptr, x, *pos, level);
|
||||
self.eval_fn_call_expr(scope, global, state, lib, this_ptr, x, x.pos, level);
|
||||
|
||||
#[cfg(feature = "debugging")]
|
||||
global.debugger.reset_status(reset_debugger);
|
||||
|
Loading…
Reference in New Issue
Block a user