@@ -78,7 +78,7 @@ void BuiltinLoader::GetNatives(Local<Name> property,
7878 Local<Object> out = Object::New (isolate);
7979 auto source = env->builtin_loader ()->source_ .read ();
8080 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 );
8282 out->Set (context, key, x.second .ToStringChecked (isolate)).FromJust ();
8383 }
8484 info.GetReturnValue ().Set (out);
@@ -207,7 +207,7 @@ MaybeLocal<String> BuiltinLoader::LoadBuiltinSource(Isolate* isolate,
207207 uv_err_name (r),
208208 uv_strerror (r),
209209 filename);
210- Local<String> message = OneByteString (isolate, buf. c_str () );
210+ Local<String> message = OneByteString (isolate, buf);
211211 isolate->ThrowException (v8::Exception::Error (message));
212212 return MaybeLocal<String>();
213213 }
@@ -277,8 +277,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
277277 }
278278
279279 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);
282281 ScriptOrigin origin (filename, 0 , 0 , true );
283282
284283 BuiltinCodeCacheData cached_data{};
@@ -595,7 +594,7 @@ void BuiltinLoader::GetBuiltinCategories(
595594 return ;
596595 if (result
597596 ->Set (context,
598- OneByteString (isolate, " cannotBeRequired" ),
597+ FIXED_ONE_BYTE_STRING (isolate, " cannotBeRequired" ),
599598 cannot_be_required_js)
600599 .IsNothing ())
601600 return ;
@@ -604,7 +603,7 @@ void BuiltinLoader::GetBuiltinCategories(
604603 return ;
605604 if (result
606605 ->Set (context,
607- OneByteString (isolate, " canBeRequired" ),
606+ FIXED_ONE_BYTE_STRING (isolate, " canBeRequired" ),
608607 can_be_required_js)
609608 .IsNothing ()) {
610609 return ;
@@ -627,7 +626,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
627626 }
628627 if (result
629628 ->Set (context,
630- OneByteString (isolate, " compiledWithCache" ),
629+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithCache" ),
631630 builtins_with_cache_js)
632631 .IsNothing ()) {
633632 return ;
@@ -639,7 +638,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
639638 }
640639 if (result
641640 ->Set (context,
642- OneByteString (isolate, " compiledWithoutCache" ),
641+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithoutCache" ),
643642 builtins_without_cache_js)
644643 .IsNothing ()) {
645644 return ;
@@ -651,7 +650,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
651650 }
652651 if (result
653652 ->Set (context,
654- OneByteString (isolate, " compiledInSnapshot" ),
653+ FIXED_ONE_BYTE_STRING (isolate, " compiledInSnapshot" ),
655654 builtins_in_snapshot_js)
656655 .IsNothing ()) {
657656 return ;
0 commit comments