Remove constants in function call expressions.
This commit is contained in:
@@ -684,16 +684,13 @@ impl Engine {
|
||||
Expr::MethodCall(x, ..)
|
||||
if _parent_chain_type == ChainType::Dotting && !x.is_qualified() =>
|
||||
{
|
||||
let crate::ast::FnCallExpr {
|
||||
args, constants, ..
|
||||
} = x.as_ref();
|
||||
let crate::ast::FnCallExpr { args, .. } = x.as_ref();
|
||||
|
||||
let (values, pos) = args.iter().try_fold(
|
||||
(crate::FnArgsVec::with_capacity(args.len()), Position::NONE),
|
||||
|(mut values, mut pos), expr| {
|
||||
let (value, arg_pos) = self.get_arg_value(
|
||||
scope, global, state, lib, this_ptr, expr, constants, level,
|
||||
)?;
|
||||
let (value, arg_pos) =
|
||||
self.get_arg_value(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
if values.is_empty() {
|
||||
pos = arg_pos;
|
||||
}
|
||||
@@ -732,15 +729,13 @@ impl Engine {
|
||||
Expr::MethodCall(x, ..)
|
||||
if _parent_chain_type == ChainType::Dotting && !x.is_qualified() =>
|
||||
{
|
||||
let crate::ast::FnCallExpr {
|
||||
args, constants, ..
|
||||
} = x.as_ref();
|
||||
let crate::ast::FnCallExpr { args, .. } = x.as_ref();
|
||||
|
||||
let (values, pos) = args.iter().try_fold(
|
||||
(crate::FnArgsVec::with_capacity(args.len()), Position::NONE),
|
||||
|(mut values, mut pos), expr| {
|
||||
let (value, arg_pos) = self.get_arg_value(
|
||||
scope, global, state, lib, this_ptr, expr, constants, level,
|
||||
scope, global, state, lib, this_ptr, expr, level,
|
||||
)?;
|
||||
if values.is_empty() {
|
||||
pos = arg_pos
|
||||
|
@@ -212,7 +212,6 @@ impl Engine {
|
||||
capture_parent_scope: capture,
|
||||
hashes,
|
||||
args,
|
||||
constants,
|
||||
..
|
||||
} = expr;
|
||||
|
||||
@@ -222,8 +221,7 @@ impl Engine {
|
||||
let hash = hashes.native;
|
||||
|
||||
return self.make_qualified_function_call(
|
||||
scope, global, state, lib, this_ptr, namespace, name, args, constants, hash, pos,
|
||||
level,
|
||||
scope, global, state, lib, this_ptr, namespace, name, args, hash, pos, level,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -234,8 +232,8 @@ impl Engine {
|
||||
);
|
||||
|
||||
self.make_function_call(
|
||||
scope, global, state, lib, this_ptr, name, first_arg, args, constants, *hashes,
|
||||
*capture, pos, level,
|
||||
scope, global, state, lib, this_ptr, name, first_arg, args, *hashes, *capture, pos,
|
||||
level,
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user