Add call_native_fn for context.
This commit is contained in:
@@ -835,7 +835,7 @@ pub mod array_functions {
|
||||
|
||||
for item in array {
|
||||
if ctx
|
||||
.call_fn_raw(OP_EQUALS, true, false, &mut [item, &mut value.clone()])
|
||||
.call_native_fn_raw(OP_EQUALS, true, &mut [item, &mut value.clone()])
|
||||
.or_else(|err| match *err {
|
||||
ERR::ErrorFunctionNotFound(ref fn_sig, ..) if fn_sig.starts_with(OP_EQUALS) => {
|
||||
if item.type_id() == value.type_id() {
|
||||
@@ -927,7 +927,7 @@ pub mod array_functions {
|
||||
|
||||
for (i, item) in array.iter_mut().enumerate().skip(start) {
|
||||
if ctx
|
||||
.call_fn_raw(OP_EQUALS, true, false, &mut [item, &mut value.clone()])
|
||||
.call_native_fn_raw(OP_EQUALS, true, &mut [item, &mut value.clone()])
|
||||
.or_else(|err| match *err {
|
||||
ERR::ErrorFunctionNotFound(ref fn_sig, ..) if fn_sig.starts_with(OP_EQUALS) => {
|
||||
if item.type_id() == value.type_id() {
|
||||
@@ -2313,7 +2313,7 @@ pub mod array_functions {
|
||||
|
||||
for (a1, a2) in array1.iter_mut().zip(array2.iter_mut()) {
|
||||
if !ctx
|
||||
.call_fn_raw(OP_EQUALS, true, false, &mut [a1, a2])
|
||||
.call_native_fn_raw(OP_EQUALS, true, &mut [a1, a2])
|
||||
.or_else(|err| match *err {
|
||||
ERR::ErrorFunctionNotFound(ref fn_sig, ..) if fn_sig.starts_with(OP_EQUALS) => {
|
||||
if a1.type_id() == a2.type_id() {
|
||||
|
@@ -213,7 +213,7 @@ mod map_functions {
|
||||
for (m1, v1) in map1 {
|
||||
if let Some(v2) = map2.get_mut(m1) {
|
||||
let equals = ctx
|
||||
.call_fn_raw(OP_EQUALS, true, false, &mut [v1, v2])?
|
||||
.call_native_fn_raw(OP_EQUALS, true, &mut [v1, v2])?
|
||||
.as_bool()
|
||||
.unwrap_or(false);
|
||||
|
||||
|
@@ -38,7 +38,7 @@ pub fn print_with_func(
|
||||
ctx: &NativeCallContext,
|
||||
value: &mut Dynamic,
|
||||
) -> crate::ImmutableString {
|
||||
match ctx.call_fn_raw(fn_name, true, false, &mut [value]) {
|
||||
match ctx.call_native_fn_raw(fn_name, true, &mut [value]) {
|
||||
Ok(result) if result.is::<crate::ImmutableString>() => {
|
||||
result.into_immutable_string().expect("`ImmutableString`")
|
||||
}
|
||||
|
Reference in New Issue
Block a user