diff --git a/ReactCommon/jsi/jsi/jsi.h b/ReactCommon/jsi/jsi/jsi.h index 2309cdaf319..94120db2781 100644 --- a/ReactCommon/jsi/jsi/jsi.h +++ b/ReactCommon/jsi/jsi/jsi.h @@ -811,18 +811,30 @@ class Function : public Object { unsigned int paramCount, jsi::HostFunctionType func); - /// Calls the function with \c count \c args. The \c this value of - /// the JS function will be undefined. + /// Calls the function with \c count \c args. The \c this value of the JS + /// function will not be set by the C++ caller, similar to calling + /// Function.prototype.apply(undefined, args) in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. Value call(Runtime& runtime, const Value* args, size_t count) const; /// Calls the function with a \c std::initializer_list of Value - /// arguments. The \c this value of the JS function will be - /// undefined. + /// arguments. The \c this value of the JS function will not be set by the + /// C++ caller, similar to calling Function.prototype.apply(undefined, args) + /// in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. Value call(Runtime& runtime, std::initializer_list args) const; /// Calls the function with any number of arguments similarly to - /// Object::setProperty(). The \c this value of the JS function - /// will be undefined. + /// Object::setProperty(). The \c this value of the JS function will not be + /// set by the C++ caller, similar to calling + /// Function.prototype.call(undefined, ...args) in JS. + /// \b Note: as with Function.prototype.call, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. template Value call(Runtime& runtime, Args&&... args) const;