summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
AgeCommit message (Collapse)Author
2021-09-09LibJS: Make Temporal foo_from_fields() AO field/options Object a const*Linus Groh
This is a bit of a lie as the Value(Object const*) ctor will const_cast them in invoke(), but at least it ensures that nothing else in the function relies on getting non-const Objects. Perhaps we can have an actual Object const* Value in the future as well.
2021-09-09LibJS: Make prepare_temporal_fields() fields Object a const&Linus Groh
This only calls Object::get() on the fields Object, which is const-qualified.
2021-09-09LibJS: Make to_temporal_time_record() time like Object a const&Linus Groh
This only calls Object::get() on the temporal_time_like Object, which is const-qualified.
2021-09-09LibJS: Make to_temporal_duration_record() time like Object a const&Linus Groh
This only calls Object::get() or some Duration getters on the temporal_duration_like Object, both of which are const-qualified.
2021-09-09LibJS: Make Temporal to_foo() AO normalized_options Object a const&Linus Groh
These only pass the normalized_options Object directly or indirectly to get_option(), which now takes a const reference.
2021-09-09LibJS: Make get_string_or_number_option() options Object a const&Linus Groh
This only passes the options Object to get_option(), which now takes a const reference.
2021-09-09LibJS: Make get_option() options Object a const&Linus Groh
This only calls Object::get() on the options Object, which is const-qualified.
2021-09-09LibJS: Store Instant's and ZonedDateTime's m_nanoseconds as a const&Linus Groh
There's no need for these to be non-const. Suggested by @IdanHo in https://github.com/SerenityOS/serenity/pull/9904#discussion_r704960184. Perhaps we can make more internal slots of these and other objects const references as well, but that's a bit more involved as they are used by various functions expecting non-const references.
2021-09-09LibJS: Make new_target parameter of all Temporal AOs a const*Linus Groh
These are passed to ordinary_create_from_constructor() in each case, which takes the parameter as a const&, so these can also be const.
2021-09-09LibJS: Mark TemporalTimeToString as infallibleLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/899cc24
2021-09-09LibJS: Implement Temporal.PlainYearMonth.compareLuke Wilde
2021-09-09LibJS: Implement Temporal.PlainYearMonth.fromLuke Wilde
2021-09-09LibJS: Implement Temporal.PlainYearMonth.prototype.equalsLuke Wilde
2021-09-09LibJS: Implement ToTemporalYearMonth AOLuke Wilde
2021-09-09LibJS: Implement Temporal.Instant.prototype.toZonedDateTimeISO()Linus Groh
2021-09-09LibJS: Implement Temporal.Instant.prototype.toZonedDateTime()Linus Groh
2021-09-09LibJS: Add a way to attach custom data to a JS::VM instanceAndreas Kling
This will be used by LibWeb to attach web engine specific stuff that LibJS doesn't need to know about.
2021-09-08LibJS: Implement Temporal.PlainTime.prototype.toJSON()Linus Groh
2021-09-08LibJS: Implement Temporal.PlainTime.prototype.toLocaleString()Linus Groh
2021-09-08LibJS: Implement Temporal.PlainTime.prototype.toString()Linus Groh
2021-09-08LibJS: Replace String const& with StringView in various Temporal AOsLinus Groh
This is especially helpful where we already pass StringView literals and only compare them with others, e.g. overflow and largest/smallest unit, in which case there's no need to actually allocate a string.
2021-09-08LibUnicode+LibJS: Store locale keyword values as a single stringTimothy Flynn
Previously, LibUnicode would store the values of a keyword as a Vector. For example, the locale "en-u-ca-abc-def" would have its keyword "ca" stored as {"abc, "def"}. Then, canonicalization would occur on each of the elements in that Vector. This is incorrect because, for example, the keyword value "true" should only be dropped if that is the entire value. That is, the canonical form of "en-u-kb-true" is "en-u-kb", but "en-u-kb-abc-true" does not change for canonicalization. However, we would canonicalize that locale as "en-u-kb-abc".
2021-09-08LibJS: Fix typos in Intl.ListFormat commentsTimothy Flynn
2021-09-08LibJS: Implement Temporal.PlainTime.prototype.withLuke Wilde
Ticks off one box in #8982 and fixes one test262 case.
2021-09-08LibJS: Add and use the CreateNegatedTemporalDuration AOLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/6178ed3
2021-09-08LibJS: Make implementation-defined language more conciseLinus Groh
This is a normative change in the Temporal spec. No behavioral change, just a clarification. See: https://github.com/tc39/proposal-temporal/commit/42c964e
2021-09-08LibJS: Use the newly added remainder operation in GetISOPartsFromEpochLinus Groh
This is a normative change in the Temporal spec. No behavioral change, just a clarification. See: https://github.com/tc39/proposal-temporal/commit/b7bdc65
2021-09-08LibJS: Validate Calendar.prototype.fields() values more strictlyLinus Groh
This is a normative change in the Temporal spec. See: - https://github.com/tc39/proposal-temporal/commit/75b66d8 - https://github.com/tc39/proposal-temporal/commit/9c2262b
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
2021-09-06LibJS: Implement Intl.ListFormat.prototype.resolvedOptionsTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.prototype.formatToPartsTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.prototype.formatTimothy Flynn
2021-09-06LibJS: Implement Intl.ListFormat.supportedLocalesOfTimothy Flynn
2021-09-06LibJS: Implement the Intl.ListFormat constructorTimothy Flynn
2021-09-06LibJS: Implement a nearly empty Intl.ListFormat objectTimothy Flynn
This adds plumbing for the Intl.ListFormat object, constructor, and prototype.
2021-09-06LibJS: Use StringViews in Round{NumberToIncrement, TemporalInstant}Idan Horowitz
2021-09-06LibJS: Implement Temporal.Instant.prototype.sinceIdan Horowitz
2021-09-06LibJS: Implement Temporal.Instant.prototype.untilIdan Horowitz
2021-09-06LibJS: Add a bunch of Temporal Abstract OperationsIdan Horowitz
These will allow us to (partially) implement Temporal.Instant.prototype.{until, since}
2021-09-06LibJS: Implement ECMA-402 String.prototype.toLocale{Lower,Upper}CaseTimothy Flynn
2021-09-06LibJS: Only remove Unicode locale extensions during the LookupMatcher AOTimothy Flynn
This was one of the first AOs used for Intl, and I misinterpreted the spec. Rather than removing all extensions, we must only remove Unicode locale extensions. Also use LocaleID::to_string() here instead of the heavier canonical string method, because the locale is already canonical.
2021-09-06LibJS: Handle possible allocation failure in ArrayBuffer(size_t)Ali Mohammad Pur
...by replacing it with a ctor that takes the buffer instead, and handling the allocation failure in ArrayBuffer::create(size_t) by throwing a RangeError as specified by the spec.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-05LibJS: Use different stack space limit values for with and without ASANLinus Groh
Instead of having a single limit here, which we had to increase once to work with ASAN enabled, check whether HAS_ADDRESS_SANITIZER is defined and use 32 KiB, and 16 KiB otherwise (which is what we used previously). This idea is shamelessly stolen from V8: https://github.com/v8/v8/blob/b2b44af/src/execution/isolate.cc#L1381-L1387
2021-09-05LibJS: Prevent stack overflow if Proxy handler's __proto__ is the ProxyLinus Groh
Fixes #9322.
2021-09-05LibJS: Add ErrorType::CallStackSizeExceededLinus Groh
I'm about to add another use of this, so let's add an ErrorType for it instead of hardcoding the message for a third time.
2021-09-04LibJS: Implement Intl.DisplayNames.supportedLocalesOf()Linus Groh
2021-09-04LibJS: Add Array::create_from() for generic Vector<T>Linus Groh
It relies on a mapper function to convert each T& to a JS::Value. This allows us to avoid awkward Vector<T> to MarkedValueList conversion at the call site.
2021-09-04LibJS: Implement Intl.Locale.prototype.minimizeTimothy Flynn
2021-09-04LibJS: Implement Intl.Locale.prototype.maximizeTimothy Flynn