@@ -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);
@@ -206,7 +206,7 @@ MaybeLocal<String> BuiltinLoader::LoadBuiltinSource(Isolate* isolate,
206
206
uv_err_name (r),
207
207
uv_strerror (r),
208
208
filename);
209
- Local<String> message = OneByteString (isolate, buf. c_str () );
209
+ Local<String> message = OneByteString (isolate, buf);
210
210
isolate->ThrowException (v8::Exception::Error (message));
211
211
return MaybeLocal<String>();
212
212
}
@@ -276,8 +276,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
276
276
}
277
277
278
278
std::string filename_s = std::string (" node:" ) + id;
279
- Local<String> filename =
280
- OneByteString (isolate, filename_s.c_str (), filename_s.size ());
279
+ Local<String> filename = OneByteString (isolate, filename_s);
281
280
ScriptOrigin origin (filename, 0 , 0 , true );
282
281
283
282
BuiltinCodeCacheData cached_data{};
@@ -594,7 +593,7 @@ void BuiltinLoader::GetBuiltinCategories(
594
593
return ;
595
594
if (result
596
595
->Set (context,
597
- OneByteString (isolate, " cannotBeRequired" ),
596
+ FIXED_ONE_BYTE_STRING (isolate, " cannotBeRequired" ),
598
597
cannot_be_required_js)
599
598
.IsNothing ())
600
599
return ;
@@ -603,7 +602,7 @@ void BuiltinLoader::GetBuiltinCategories(
603
602
return ;
604
603
if (result
605
604
->Set (context,
606
- OneByteString (isolate, " canBeRequired" ),
605
+ FIXED_ONE_BYTE_STRING (isolate, " canBeRequired" ),
607
606
can_be_required_js)
608
607
.IsNothing ()) {
609
608
return ;
@@ -626,7 +625,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
626
625
}
627
626
if (result
628
627
->Set (context,
629
- OneByteString (isolate, " compiledWithCache" ),
628
+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithCache" ),
630
629
builtins_with_cache_js)
631
630
.IsNothing ()) {
632
631
return ;
@@ -638,7 +637,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
638
637
}
639
638
if (result
640
639
->Set (context,
641
- OneByteString (isolate, " compiledWithoutCache" ),
640
+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithoutCache" ),
642
641
builtins_without_cache_js)
643
642
.IsNothing ()) {
644
643
return ;
@@ -650,7 +649,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
650
649
}
651
650
if (result
652
651
->Set (context,
653
- OneByteString (isolate, " compiledInSnapshot" ),
652
+ FIXED_ONE_BYTE_STRING (isolate, " compiledInSnapshot" ),
654
653
builtins_in_snapshot_js)
655
654
.IsNothing ()) {
656
655
return ;
0 commit comments