| 160 | } |
| 161 | |
| 162 | jni::local_ref<JavaScriptObject::javaobject> JavaScriptValue::getObject() { |
| 163 | auto runtime = runtimeHolder.lock(); |
| 164 | assert((runtime != nullptr) && "JS Runtime was used after deallocation"); |
| 165 | auto &rawRuntime = runtime->get(); |
| 166 | |
| 167 | auto jsObject = std::make_shared<jsi::Object>(jsValue->getObject(rawRuntime)); |
| 168 | return JavaScriptObject::newInstance( |
| 169 | expo::getJSIContext(rawRuntime), |
| 170 | runtimeHolder, |
| 171 | jsObject |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | jni::local_ref<JavaScriptFunction::javaobject> JavaScriptValue::jniGetFunction() { |
| 176 | auto runtime = runtimeHolder.lock(); |