mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Use FlyString in PropertyKey instead of DeprecatedFlyString
This required dealing with *substantial* fallout.
This commit is contained in:
committed by
Andreas Kling
parent
fc744e3f3f
commit
46a5710238
Notes:
github-actions[bot]
2025-03-24 22:28:26 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/46a57102387 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4067 Reviewed-by: https://github.com/trflynn89
@@ -13,15 +13,15 @@ namespace JS {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(ModuleNamespaceObject);
|
||||
|
||||
ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<DeprecatedFlyString> exports)
|
||||
ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<FlyString> exports)
|
||||
: Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().object_prototype(), MayInterfereWithIndexedPropertyAccess::Yes)
|
||||
, m_module(module)
|
||||
, m_exports(move(exports))
|
||||
{
|
||||
// Note: We just perform step 6 of 10.4.6.12 ModuleNamespaceCreate ( module, exports ), https://tc39.es/ecma262/#sec-modulenamespacecreate
|
||||
// 6. Let sortedExports be a List whose elements are the elements of exports ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using undefined as comparefn.
|
||||
quick_sort(m_exports, [&](DeprecatedFlyString const& lhs, DeprecatedFlyString const& rhs) {
|
||||
return lhs.view() < rhs.view();
|
||||
quick_sort(m_exports, [&](FlyString const& lhs, FlyString const& rhs) {
|
||||
return lhs.bytes_as_string_view() < rhs.bytes_as_string_view();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user