jsi::Runtime implementations
| 423 | // jsi::Runtime implementations |
| 424 | // |
| 425 | jsi::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 | |
| 439 | std::shared_ptr<const jsi::PreparedJavaScript> V8Runtime::prepareJavaScript( |
| 440 | const std::shared_ptr<const jsi::Buffer> &buffer, |