diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e93b74da..00a859c5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - ESP32-P4 command `HostedOta` (#23675) - Support for RV3028 RTC (#23672) - Berry preview of animation framework (#23740) +- Berry `call()` now works for classes ### Breaking Changed diff --git a/lib/libesp32/berry/src/be_baselib.c b/lib/libesp32/berry/src/be_baselib.c index 2a8d36fd6..ae55b6306 100644 --- a/lib/libesp32/berry/src/be_baselib.c +++ b/lib/libesp32/berry/src/be_baselib.c @@ -319,7 +319,7 @@ int be_baselib_iterator(bvm *vm) static int l_call(bvm *vm) { int top = be_top(vm); - if (top >= 1 && be_isfunction(vm, 1)) { + if (top >= 1 && (be_isfunction(vm, 1) || be_isclass(vm, 1))) { size_t arg_count = top - 1; /* we have at least 'top - 1' arguments */ /* test if last argument is a list */ @@ -354,7 +354,7 @@ static int l_call(bvm *vm) be_return(vm); } - be_raise(vm, "value_error", "first argument must be a function"); + be_raise(vm, "value_error", "first argument must be a function or a class"); be_return_nil(vm); }