MCPcopy Create free account
hub / github.com/Kudo/react-native-v8 / evaluateJavaScript

Method evaluateJavaScript

src/v8runtime/V8Runtime.cpp:425–437  ·  view source on GitHub ↗

jsi::Runtime implementations

Source from the content-addressed store, hash-verified

423// jsi::Runtime implementations
424//
425jsi::Value V8Runtime::evaluateJavaScript(
426 const std::shared_ptr<const jsi::Buffer> &buffer,
427 const std::string &sourceURL) {
428 v8::Locker locker(isolate_);
429 v8::Isolate::Scope scopedIsolate(isolate_);
430 v8::HandleScope scopedHandle(isolate_);
431 v8::Context::Scope scopedContext(context_.Get(isolate_));
432 v8::Local<v8::String> string;
433 if (JSIV8ValueConverter::ToV8String(*this, buffer).ToLocal(&string)) {
434 return ExecuteScript(isolate_, string, sourceURL);
435 }
436 return {};
437}
438
439std::shared_ptr<const jsi::PreparedJavaScript> V8Runtime::prepareJavaScript(
440 const std::shared_ptr<const jsi::Buffer> &buffer,

Callers

nothing calls this directly

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected