@@ -1344,7 +1344,7 @@ inline Function Function::New(napi_env env,
13441344 Callable cb,
13451345 const char * utf8name,
13461346 void * data) {
1347- auto function{jsi::Function::createFromHostFunction (env->rt , jsi::PropNameID::forUtf8 (env->rt , utf8name), 0 ,
1347+ auto function{jsi::Function::createFromHostFunction (env->rt , jsi::PropNameID::forUtf8 (env->rt , utf8name == nullptr ? " " : utf8name ), 0 ,
13481348 [env, cb{std::move (cb)}, data](jsi::Runtime&, const jsi::Value& thisVal, const jsi::Value* args, size_t count) -> jsi::Value {
13491349 typedef decltype (cb (CallbackInfo ({}, {}, {}, {}, {}, {}))) ReturnType;
13501350 return details::Function<Callable, ReturnType>::Callback (env, thisVal, args, count, data, cb);
@@ -1569,7 +1569,12 @@ inline Error::Error(napi_env env, jsi::Object object)
15691569 : ObjectReference{env, std::move (object)} {
15701570}
15711571
1572- inline Error::Error (Error&& other) : ObjectReference(other) {
1572+ inline Error::Error (napi_env env, jsi::Value value)
1573+ : ObjectReference{env, value.getObject (env->rt )} {
1574+ }
1575+
1576+ inline Error::Error (Error&& other)
1577+ : ObjectReference(other) {
15731578}
15741579
15751580inline Error& Error::operator =(Error&& other) {
@@ -1623,6 +1628,10 @@ inline TypeError::TypeError(napi_env env, jsi::Object object)
16231628 : Error{env, std::move (object)} {
16241629}
16251630
1631+ inline TypeError::TypeError (napi_env env, jsi::Value value)
1632+ : Error{env, std::move (value)} {
1633+ }
1634+
16261635inline RangeError RangeError::New (napi_env env, const char * message) {
16271636 return Error::New<RangeError, const char *>(env, message, " RangeError" );
16281637}
@@ -1635,6 +1644,10 @@ inline RangeError::RangeError(napi_env env, jsi::Object object)
16351644 : Error{env, std::move (object)} {
16361645}
16371646
1647+ inline RangeError::RangeError (napi_env env, jsi::Value value)
1648+ : Error{env, std::move (value)} {
1649+ }
1650+
16381651// //////////////////////////////////////////////////////////////////////////////
16391652// Reference<T> class
16401653// //////////////////////////////////////////////////////////////////////////////
0 commit comments