add support for non-memmber functions
This commit is contained in:
parent
17e5946af4
commit
fea0b69865
|
@ -295,7 +295,7 @@ void Realm<T>::constructor(ContextType ctx, ObjectType this_object, size_t argc,
|
|||
create_object<T, RealmClass<T>>(ctx, new SharedRealm(old_realm)),
|
||||
create_object<T, RealmClass<T>>(ctx, new SharedRealm(realm))
|
||||
};
|
||||
Function<T>::call(ctx, migration_function, nullptr, 2, arguments);
|
||||
Function<T>::call(ctx, migration_function, 2, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -129,6 +129,9 @@ struct Function {
|
|||
using ValueType = typename T::Value;
|
||||
|
||||
static ValueType call(ContextType, const FunctionType &, const ObjectType &, size_t, const ValueType[]);
|
||||
static ValueType call(ContextType ctx, const FunctionType &function, size_t argument_count, const ValueType arguments[]) {
|
||||
return call(ctx, function, {}, argument_count, arguments);
|
||||
}
|
||||
static ValueType call(ContextType ctx, const FunctionType &function, const ObjectType &this_object, const std::vector<ValueType> &arguments) {
|
||||
return call(ctx, function, this_object, arguments.size(), arguments.data());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue