@@ -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);
@@ -206,7 +206,7 @@ MaybeLocal<String> BuiltinLoader::LoadBuiltinSource(Isolate* isolate,
206206 uv_err_name (r),
207207 uv_strerror (r),
208208 filename);
209- Local<String> message = OneByteString (isolate, buf. c_str () );
209+ Local<String> message = OneByteString (isolate, buf);
210210 isolate->ThrowException (v8::Exception::Error (message));
211211 return MaybeLocal<String>();
212212 }
@@ -276,8 +276,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
276276 }
277277
278278 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);
281280 ScriptOrigin origin (filename, 0 , 0 , true );
282281
283282 BuiltinCodeCacheData cached_data{};
@@ -594,7 +593,7 @@ void BuiltinLoader::GetBuiltinCategories(
594593 return ;
595594 if (result
596595 ->Set (context,
597- OneByteString (isolate, " cannotBeRequired" ),
596+ FIXED_ONE_BYTE_STRING (isolate, " cannotBeRequired" ),
598597 cannot_be_required_js)
599598 .IsNothing ())
600599 return ;
@@ -603,7 +602,7 @@ void BuiltinLoader::GetBuiltinCategories(
603602 return ;
604603 if (result
605604 ->Set (context,
606- OneByteString (isolate, " canBeRequired" ),
605+ FIXED_ONE_BYTE_STRING (isolate, " canBeRequired" ),
607606 can_be_required_js)
608607 .IsNothing ()) {
609608 return ;
@@ -626,7 +625,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
626625 }
627626 if (result
628627 ->Set (context,
629- OneByteString (isolate, " compiledWithCache" ),
628+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithCache" ),
630629 builtins_with_cache_js)
631630 .IsNothing ()) {
632631 return ;
@@ -638,7 +637,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
638637 }
639638 if (result
640639 ->Set (context,
641- OneByteString (isolate, " compiledWithoutCache" ),
640+ FIXED_ONE_BYTE_STRING (isolate, " compiledWithoutCache" ),
642641 builtins_without_cache_js)
643642 .IsNothing ()) {
644643 return ;
@@ -650,7 +649,7 @@ void BuiltinLoader::GetCacheUsage(const FunctionCallbackInfo<Value>& args) {
650649 }
651650 if (result
652651 ->Set (context,
653- OneByteString (isolate, " compiledInSnapshot" ),
652+ FIXED_ONE_BYTE_STRING (isolate, " compiledInSnapshot" ),
654653 builtins_in_snapshot_js)
655654 .IsNothing ()) {
656655 return ;
0 commit comments