Map in operator to contains function call.

This commit is contained in:
Stephen Chung
2021-03-09 13:44:54 +08:00
parent ff7844893d
commit 975bb3d6bf
11 changed files with 76 additions and 283 deletions

View File

@@ -13,8 +13,8 @@ def_package!(crate:BasicMapPackage:"Basic object map utilities.", lib, {
#[export_module]
mod map_functions {
#[rhai_fn(pure)]
pub fn has(map: &mut Map, prop: ImmutableString) -> bool {
#[rhai_fn(name = "has", pure)]
pub fn contains(map: &mut Map, prop: ImmutableString) -> bool {
map.contains_key(&prop)
}
#[rhai_fn(pure)]