| 534 | #endif |
| 535 | |
| 536 | jsi::Runtime::PointerValue *V8Runtime::cloneString( |
| 537 | const Runtime::PointerValue *pv) { |
| 538 | if (!pv) { |
| 539 | return nullptr; |
| 540 | } |
| 541 | |
| 542 | v8::Locker locker(isolate_); |
| 543 | v8::Isolate::Scope scopedIsolate(isolate_); |
| 544 | v8::HandleScope scopedHandle(isolate_); |
| 545 | v8::Context::Scope scopedContext(context_.Get(isolate_)); |
| 546 | |
| 547 | const V8PointerValue *v8PointerValue = |
| 548 | static_cast<const V8PointerValue *>(pv); |
| 549 | assert(v8PointerValue->Get(isolate_)->IsString()); |
| 550 | return new V8PointerValue(isolate_, v8PointerValue->Get(isolate_)); |
| 551 | } |
| 552 | |
| 553 | jsi::Runtime::PointerValue *V8Runtime::cloneObject( |
| 554 | const Runtime::PointerValue *pv) { |