mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-02 15:37:42 +00:00
Berry call()
now works for classes (#23744)
This commit is contained in:
parent
5416890f11
commit
95f7e39672
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user