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

Method createStringFromUtf8

src/v8runtime/V8Runtime.cpp:797–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797jsi::String V8Runtime::createStringFromUtf8(const uint8_t *str, size_t length) {
798 v8::Locker locker(isolate_);
799 v8::Isolate::Scope scopedIsolate(isolate_);
800 v8::HandleScope scopedHandle(isolate_);
801 v8::Context::Scope scopedContext(context_.Get(isolate_));
802
803 V8PointerValue *value = V8PointerValue::createFromUtf8(isolate_, str, length);
804 if (!value) {
805 throw jsi::JSError(*this, "createFromUtf8() - string creation failed.");
806 }
807
808 return make<jsi::String>(value);
809}
810
811std::string V8Runtime::utf8(const jsi::String &str) {
812 v8::Locker locker(isolate_);

Callers

nothing calls this directly

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected