Skip to content

Commit c05de02

Browse files
committed
fixup! src: use Utf8Value and TwoByteValue instead of V8 helpers
1 parent 2f9d49a commit c05de02

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/api/hooks.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ using v8::Isolate;
1212
using v8::Just;
1313
using v8::Local;
1414
using v8::Maybe;
15+
using v8::NewStringType;
1516
using v8::Nothing;
1617
using v8::Object;
1718
using v8::String;
@@ -209,9 +210,10 @@ async_context EmitAsyncInit(Isolate* isolate,
209210
std::string_view name,
210211
async_id trigger_async_id) {
211212
HandleScope handle_scope(isolate);
212-
Local<String> type = ToV8Value(isolate->GetCurrentContext(), name, isolate)
213-
.ToLocalChecked()
214-
.As<String>();
213+
Local<String> type =
214+
String::NewFromUtf8(
215+
isolate, name.data(), NewStringType::kInternalized, name.size())
216+
.ToLocalChecked();
215217
return EmitAsyncInit(isolate, resource, type, trigger_async_id);
216218
}
217219

0 commit comments

Comments
 (0)