summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
AgeCommit message (Collapse)Author
2022-11-06Everywhere: Remove redundant inequality comparison operatorsDaniel Bertalan
C++20 can automatically synthesize `operator!=` from `operator==`, so there is no point in writing such functions by hand if all they do is call through to `operator==`. This fixes a compile error with compilers that implement P2468 (Clang 16 currently). This paper restores the C++17 behavior that if both `T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators makes the rewriting possible again. See https://reviews.llvm.org/D134529#3853062
2022-11-06LibJS: Remove the now-unused LocalTZA AOTimothy Flynn
2022-11-06LibJS: Change ToLocalTime to use epoch nanosecondsTimothy Flynn
This is an editorial change to the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/b3f9a1b
2022-11-06LibJS: Remove infallibility marker from DefaultTimeZone invocationTimothy Flynn
This is an editorial change to the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/46aa5cc Also add an ECMA-402 spec link to the DefaultTimeZone implementation, as that definition supersedes ECMA-262.
2022-11-05LibJS: Rename ToShowTimeZoneNameOption to ToTimeZoneNameOptionSmrtnyk
This is an editorial change in Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/ab5b1ba91054a921e2ae129e3fe024bd1c6e7f2f
2022-11-04LibJS: Use more accurate number-to-string method in Number toExponentialTimothy Flynn
2022-11-04LibJS: Use more accurate number-to-string method in Number toPrecisionTimothy Flynn
2022-11-04LibJS: Use more accurate number-to-string method in Intl.NumberFormatTimothy Flynn
Intl.NumberFormat only ever wants literal number-to-digits here, without extra exponential formatting.
2022-11-04LibJS: Publicly expose double_to_string and rename it number_to_stringTimothy Flynn
Rename it to match the name used by the spec. Add an override mode to skip formatting numbers with an exponential sign (e.g. 1e23). This mode is needed by Number and Intl.NumberFormat, who don't call out a specific number-to-string method to use (they just say to make "the String consisting of the digits of n").
2022-11-04LibJS: Rename ToShowCalendarOption to ToCalendarNameOptionSmrtnyk
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/2c9e2615f74a5ff15a812dac5cc2c3fa0c4a5922
2022-11-03LibJS: Implement precise double_to_stringDan Klishch
2022-11-03LibJS: Fix length of PlainDateTime.withPlainTimeLuke Wilde
withPlainTime's argument is optional, so the length of the function is actually 0.
2022-11-03LibJS: Add timeZoneName: "critical" option to ZonedDateTime.toString()Luke Wilde
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/d84937f
2022-11-03LibJS: Add calendarName: "critical" option to toString() methods Luke Wilde
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/e715a50
2022-11-03LibJS: Align ISO 8601 grammar with annotations from IXDTFLuke Wilde
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/c64b844
2022-11-03LibJS: Delegate to NumberFormat for DurationFormat unit formattingTimothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/12ba9df
2022-11-03LibJS+LibUnicode: Add "microsecond" and "nanosecond" as sanctioned unitsTimothy Flynn
This is a normative change in the ECMA-402 spec. See: https://github.com/tc39/ecma402/commit/f627573
2022-11-03LibJS: Format sanctioned units such that there is one unit per lineTimothy Flynn
Much easier to manage and view diffs this way, rather than one large single line. This will soon be the only method in this file, so there's no concern over taking up too much vertical space here.
2022-11-03Everywhere: Clean up "the the" comment typosNico Weber
2022-11-03LibJS: Rename the Intl Enumeration Available* AOs to AvailableCanonical*Timothy Flynn
This is an editorial change to the Intl Enumeration API proposal. See: https://github.com/tc39/proposal-intl-enumeration/commit/807b444 Note that this was followed by a normative change to actually ensure the returned values are canonical: https://github.com/tc39/proposal-intl-enumeration/commit/075a6dc But the values we return are already canonical.
2022-11-02LibJS: Use the UnsignedBigInteger compare_to_double algorithmMoustafa Raafat
This also avoids an unnecessary copy
2022-11-02LibCrypto: Add a way to compare UnsignedBigInteger with doubleMoustafa Raafat
This patch also make SignedBigInteger::compare_to_double make use of the new function.
2022-11-01LibJS: Map DurationFormat's list style to "short" when it is "digital"Timothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/7495e32
2022-11-01LibJS: Alphabetically sort the collations returned by CollationsOfLocaleTimothy Flynn
This is a normative change in the Intl Locale Info proposal. See: https://github.com/tc39/proposal-intl-locale-info/commit/171d3ad Note this doesn't affect us because we don't have collation info from the CLDR; we just return ["default"] here.
2022-10-24AK+Everywhere: Turn bool keep_empty to an enum in split* functionsdemostanis
2022-10-24LibJS: Accept calendar names case-insensitivelyYedaya Katsman
This is a normative change in the Temporal spec See tc39/proposal-temporal@03101c6
2022-10-23LibJS: Make parseFloat use the new double parserdavidot
This means it no longer is locale dependent and doesn't incorrectly accept hex floats anymore.
2022-10-23LibJS: Make string_to_double use the new double parserdavidot
2022-10-23LibJS: Make canonical_numeric_index_string use the new double parserdavidot
2022-10-23LibJS: Make parse_temporal_duration use the new double parserdavidot
2022-10-23LibJS: Make PluralRules use the new double parserdavidot
2022-10-23LibJS: Fix that non-double numbers from JSON were truncated to i32davidot
2022-10-22LibJS: Require NanosecondsToDays remainder less than dayLengthMoustafa Raafat
This is an normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/ac69b63
2022-10-22LibJS: Require that NanosecondsToDays doesn't flip signMoustafa Raafat
This is an normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/e13c52d
2022-10-20LibJS: Make define_native_foo() take SafeFunctionsAndreas Kling
We were taking AK::Function and then passing them along to NativeFunction, which takes a SafeFunction. This works, since SafeFunction will transparently wrap AK::Function in a CallableWrapper when assigned, but it was causing us to accumulate thousands of pointless wrappers around direct function pointers. By using SafeFunction at every step of the setup call chain, we no longer create any CallableWrappers for the majority of native functions in LibJS. Also, the number of heap-registered SafeFunctions in a new realm goes down from ~5000 to 5. :^)
2022-10-20LibJS: Refactor CalendarFields for better linearityMoustafa Raafat
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/9b139a1
2022-10-20LibJS: Simplify ParseTemporalTimeZoneStringIdan Horowitz
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/eec8efab
2022-10-20LibJS: Refactor ToRelativeTemporalObjectIdan Horowitz
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/895854d9
2022-10-19LibJS: Remove trivial operations ISO{Year,Month,Day}Moustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/606d8a2
2022-10-19LibJS: Remove trivial operation IsValidISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/a08330a
2022-10-19LibJS: Merge ISOMonthCode and BuildISOMonthCodeMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/a4d17b1
2022-10-19LibJS: Improve alias names in ResolveISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/01d5fbe
2022-10-19LibJS: Simplify ResolveISOMonthMoustafa Raafat
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/1b83226
2022-10-19LibJS: Avoid expensive UTF-8/16 conversion in legacy RegExp propertiesAndreas Kling
Let's not incur the cost of a synchronous conversion to UTF-8 for all the legacy static properties after running a regular expression. The SunSpider subtest regexp-dna goes from taking ~25 sec to ~0.7 sec on my machine.
2022-10-17LibJS: Implement RegExp legacy static propertiesleeight
RegExp legacy static properties Spec url is https://github.com/tc39/proposal-regexp-legacy-features
2022-10-17LibJS: Sync the set of rounding modesLinus Groh
This is a normative change in the Temporal spec. See: - https://github.com/tc39/proposal-temporal/commit/9613358 - https://github.com/tc39/proposal-temporal/commit/4c45464
2022-10-17LibJS: Add missing validation to remaining Calendar operationsLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/c2a0cea
2022-10-17LibJS: Reject relativeTo string such as "2022-08-18T17:01Z"Linus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/2dc20bf
2022-10-17LibJS: Rename IsValidTimeZoneName to IsAvailableTimeZoneNameLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/873313b
2022-10-17LibJS: Define IsValidTimeZoneName in terms of AvailableTimeZonesLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/d83dcf0 Note that even though we already implement AvailableTimeZones for Intl, I kept the existing implementation calling into LibTimeZone directly.