diff --git a/lib/libesp32/berry/generate/be_fixed_be_class_map.h b/lib/libesp32/berry/generate/be_fixed_be_class_map.h index d9ce16027..db15432d4 100644 --- a/lib/libesp32/berry/generate/be_fixed_be_class_map.h +++ b/lib/libesp32/berry/generate/be_fixed_be_class_map.h @@ -1,23 +1,24 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_map_map) { - { be_const_key(size, -1), be_const_func(m_size) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, - { be_const_key(insert, -1), be_const_func(m_insert) }, - { be_const_key(init, -1), be_const_func(m_init) }, { be_const_key(contains, -1), be_const_func(m_contains) }, + { be_const_key(item, 4), be_const_func(m_item) }, + { be_const_key(setitem, 9), be_const_func(m_setitem) }, + { be_const_key(has, -1), be_const_func(m_contains) }, { be_const_key(keys, -1), be_const_func(m_keys) }, + { be_const_key(init, -1), be_const_func(m_init) }, + { be_const_key(remove, 5), be_const_func(m_remove) }, + { be_const_key(size, -1), be_const_func(m_size) }, + { be_const_key(iter, -1), be_const_func(m_iter) }, + { be_const_key(insert, -1), be_const_func(m_insert) }, { be_const_key(_X2Ep, -1), be_const_var(0) }, - { be_const_key(iter, 6), be_const_func(m_iter) }, - { be_const_key(setitem, 2), be_const_func(m_setitem) }, - { be_const_key(remove, -1), be_const_func(m_remove) }, - { be_const_key(item, 11), be_const_func(m_item) }, - { be_const_key(find, -1), be_const_func(m_find) }, + { be_const_key(find, 8), be_const_func(m_find) }, }; static be_define_const_map( be_class_map_map, - 12 + 13 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/lib/libesp32/berry/src/be_maplib.c b/lib/libesp32/berry/src/be_maplib.c index d1574f280..fc9f09fe7 100644 --- a/lib/libesp32/berry/src/be_maplib.c +++ b/lib/libesp32/berry/src/be_maplib.c @@ -224,6 +224,7 @@ void be_load_maplib(bvm *vm) { "setitem", m_setitem }, { "find", m_find }, { "contains", m_contains }, + { "has", m_contains }, /* deprecated */ { "size", m_size }, { "insert", m_insert }, { "iter", m_iter }, @@ -243,6 +244,7 @@ class be_class_map (scope: global, name: map) { setitem, func(m_setitem) find, func(m_find) contains, func(m_contains) + has, func(m_contains) size, func(m_size) insert, func(m_insert) iter, func(m_iter)