mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibJS: Define constructor slots for describing how to read options
This is an editorial change in the ECMA-402 spec. See:
a2beb66
We implement this change by introducing a virtual interface that all
Intl "service" objects must implement. A future patch will make use of
the virtualized RelevantExtensionKeys and ResolutionOptionDescriptors
accessors, and we will need to be able to use those slots from a generic
instance type.
This commit is contained in:
parent
19ce186f97
commit
62793b1bd8
Notes:
github-actions[bot]
2025-04-08 10:53:24 +00:00
Author: https://github.com/trflynn89
Commit: 62793b1bd8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4275
29 changed files with 284 additions and 116 deletions
|
@ -4,9 +4,9 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/Intl/AbstractOperations.h>
|
||||
#include <LibJS/Runtime/Intl/DisplayNames.h>
|
||||
#include <LibJS/Runtime/VM.h>
|
||||
|
||||
namespace JS::Intl {
|
||||
|
||||
|
@ -14,10 +14,24 @@ GC_DEFINE_ALLOCATOR(DisplayNames);
|
|||
|
||||
// 12 DisplayNames Objects, https://tc39.es/ecma402/#intl-displaynames-objects
|
||||
DisplayNames::DisplayNames(Object& prototype)
|
||||
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
||||
: IntlObject(ConstructWithPrototypeTag::Tag, prototype)
|
||||
{
|
||||
}
|
||||
|
||||
// 12.2.3 Internal slots, https://tc39.es/ecma402/#sec-Intl.DisplayNames-internal-slots
|
||||
ReadonlySpan<StringView> DisplayNames::relevant_extension_keys() const
|
||||
{
|
||||
// The value of the [[RelevantExtensionKeys]] internal slot is « ».
|
||||
return {};
|
||||
}
|
||||
|
||||
// 12.2.3 Internal slots, https://tc39.es/ecma402/#sec-Intl.DisplayNames-internal-slots
|
||||
ReadonlySpan<ResolutionOptionDescriptor> DisplayNames::resolution_option_descriptors(VM&) const
|
||||
{
|
||||
// The value of the [[ResolutionOptionDescriptors]] internal slot is « ».
|
||||
return {};
|
||||
}
|
||||
|
||||
void DisplayNames::set_type(StringView type)
|
||||
{
|
||||
if (type == "language"sv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue