@@ -78,7 +78,7 @@ void BuiltinLoader::GetNatives(Local<Name> property,
78
78
Local<Object> out = Object::New (isolate);
79
79
auto source = env->builtin_loader ()->source_ .read ();
80
80
for (auto const & x : *source) {
81
- Local<String> key = OneByteString (isolate, x.first . c_str (), x. first . size () );
81
+ Local<String> key = OneByteString (isolate, x.first );
82
82
out->Set (context, key, x.second .ToStringChecked (isolate)).FromJust ();
83
83
}
84
84
info.GetReturnValue ().Set (out);
@@ -207,7 +207,7 @@ MaybeLocal<String> BuiltinLoader::LoadBuiltinSource(Isolate* isolate,
207
207
uv_err_name (r),
208
208
uv_strerror (r),
209
209
filename);
210
- Local<String> message = OneByteString (isolate, buf. c_str () );
210
+ Local<String> message = OneByteString (isolate, buf);
211
211
isolate->ThrowException (v8::Exception::Error (message));
212
212
return MaybeLocal<String>();
213
213
}
@@ -277,8 +277,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
277
277
}
278
278
279
279
std::string filename_s = std::string (" node:" ) + id;
280
- Local<String> filename =
281
- OneByteString (isolate, filename_s.c_str (), filename_s.size ());
280
+ Local<String> filename = OneByteString (isolate, filename_s);
282
281
ScriptOrigin origin (filename, 0 , 0 , true );
283
282
284
283
BuiltinCodeCacheData cached_data{};
@@ -595,7 +594,7 @@ void BuiltinLoader::GetBuiltinCategories(
595
594
return ;
596
595
if (result
597
596
->Set (context,
598
- OneByteString (isolate, " cannotBeRequired" ),
597
+ FIXED_ONE_BYTE_STRING (isolate, " cannotBeRequired" ),
599
598
cannot_be_required_js)
600
599
.IsNothing ())
601
600
return ;
@@ -604,7 +603,7 @@ void BuiltinLoader::GetBuiltinCategories(
604
603
return ;
605
604
if (result
606
605
->Set (context,
607
- OneByteString (isolate, " canBeRequired" ),
606
+ FIXED_ONE_BYTE_STRING (isolate, " canBeRequired" ),
608
607
can_be_required_js)
609
608
.IsNothing ()) {
610
609
return ;
@@ -627,7 +626,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
627
626
}
628
627
if (result
629
628
->Set (context,
630
- OneByteString (isolate, " compiledWithCache" ),
629
+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithCache" ),
631
630
builtins_with_cache_js)
632
631
.IsNothing ()) {
633
632
return ;
@@ -639,7 +638,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
639
638
}
640
639
if (result
641
640
->Set (context,
642
- OneByteString (isolate, " compiledWithoutCache" ),
641
+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithoutCache" ),
643
642
builtins_without_cache_js)
644
643
.IsNothing ()) {
645
644
return ;
@@ -651,7 +650,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
651
650
}
652
651
if (result
653
652
->Set (context,
654
- OneByteString (isolate, " compiledInSnapshot" ),
653
+ FIXED_ONE_BYTE_STRING (isolate, " compiledInSnapshot" ),
655
654
builtins_in_snapshot_js)
656
655
.IsNothing ()) {
657
656
return ;
0 commit comments