mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16
This has quite a lot of fall out. But the majority of it is just type or UDL substitution, where the changes just fall through to other function calls. By changing property key storage to UTF-16, the main affected areas are: * NativeFunction names must now be UTF-16 * Bytecode identifiers must now be UTF-16 * Module/binding names must now be UTF-16
This commit is contained in:
Notes:
github-actions[bot]
2025-08-05 11:08:30 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0efa98a57a5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5698
@@ -13,16 +13,14 @@ namespace JS {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(ModuleNamespaceObject);
|
||||
|
||||
ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<FlyString> exports)
|
||||
ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vector<Utf16FlyString> 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, [&](FlyString const& lhs, FlyString const& rhs) {
|
||||
return lhs.bytes_as_string_view() < rhs.bytes_as_string_view();
|
||||
});
|
||||
quick_sort(m_exports);
|
||||
}
|
||||
|
||||
void ModuleNamespaceObject::initialize(Realm& realm)
|
||||
|
||||
Reference in New Issue
Block a user