summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
AgeCommit message (Collapse)Author
2022-10-25LibLocale+LibJS: Update to CLDR version 42.0.0Timothy Flynn
There were some notable changes to the CLDR JSON format and data in this release. The patterns for a date at a specific time, i.e. "{date} at {time}", now appear under the "atTime" attribute of the "dateTimeFormats" object. Locale specific changes that affected test-js: All locales: * In many patterns, the code points U+00A0 (NO-BREAK SPACE) and U+202F (NARROW NO-BREAK SPACE) are now used in place of an ASCII space. For example, before the "dayPeriod" fields AM and PM. * Separators such as U+2013 (EN DASH) are now surrounded by U+2009 (THIN SPACE) in place of an ASCII space character. Locale "en": * Narrow localizations of time formats are even more narrow. For example, the abbreviation "wk." for "week" is now just "wk". Locale "ar": * The code point U+060C (ARABIC COMMA) is now used in place of an ASCII comma. * The code point U+200F (RIGHT-TO-LEFT MARK) now appears at the beginning of many localizations. * When the "latn" numbering system is used for currency formatting, the currency symbol more consistently is placed at the end of the pattern. Locale "he": * The "many" plural rules category has been removed. Locales "zh" and "es-419": * Several display-name localizations were changed.
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-24LibJS: Only use 1 bit for Cell boolean flagAndreas Kling
2022-10-24LibJS: Add Cell::must_survive_garbage_collection() mechanismAndreas Kling
This allows cells to prevent themselves from being garbage collected, even when there are no references to them.
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: Make Token use the new double parserdavidot
2022-10-23LibJS: Fix that non-double numbers from JSON were truncated to i32davidot
2022-10-23LibJS: Make a TypedArray test actually run on all different typesdavidot
2022-10-23LibJS: Add descriptive output to test-commons expect().toThrow()davidot
This (and still some other methods) just say Expectation error leaving the user completely in the dark whether the method threw at all. And since we have nice function printing now we can just toString the function since most are lambda's.
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: Add a finalization pass to the garbage collectorAndreas Kling
Doing things in the destructor of a GC-allocated object isn't always safe, in case it involves accessing other GC-allocated objects. If they were already swept by GC, we'd be poking into freed memory. This patch adds a separate finalization pass where GC calls finalize() on every unmarked cell that's about to be deleted. It's safe to access other GC objects in finalize(), even if they're also unmarked.
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: Don't register SafeFunction-to-function-pointer with JS::HeapAndreas Kling
Direct function pointers don't have captures, so we don't need to register the SafeFunction with the Heap when it's just wrapping a function pointer.
2022-10-20LibJS: Remove unnecessary operator==() for ({Nonnull,}GCPtr<T>, T*)Andreas Kling
These aren't necessary in the first place since {Nonnull,}GCPtr has operator T*()
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: Support non-base-10 BigInt literals in bytecode VMAndreas Kling
Fixes 39 tests in test262 and a handful in test-js. :^)
2022-10-19LibJS: Support `for (x in obj)` iteration in bytecode VMAndreas Kling
We were mistakenly treating these as `for (x of obj)`. By reorganizing the code a little bit, we actually support both kinds of iteration with less duplication. :^) Fixes 17 tests in test262.
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-19LibJS: Disable bytecode optimizations by defaultAndreas Kling
The optimization passes are not stable, which makes test262 flaky. Address this by introducing a new OptimizationLevel::None and making it the default. This removes all the flakiness from test262 in my testing. We can enable optimizations by default again once they have been made stable. :^)
2022-10-18LibTimeZone+LibJS: Update to TZDB version 2022eTimothy Flynn
https://mm.icann.org/pipermail/tz-announce/2022-October/000074.html This version changes America/Chicago's transtion from LMT to CST from 1883 Nov 18 12:09:24 to 1883 Nov 18 18:00.
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.
2022-10-17LibJS: Forward a string aproximation of the CallExpression to Call OpsHendiadyoin1
This gives us better debug output when analysing calls to `undefined` and also fixes multiple test-js cases expecting an `(evaluated from $Expression)` in the error message. This also refactors out the generation of that string, to avoid code duplication with the AST interpreter.
2022-10-16LibJS: Add spec comments to RegExpObjectLinus Groh
Also fix the evaluation order of ToString for pattern and flags while we're here, and improve some of the variable names.
2022-10-16LibJS: Add spec comments to RegExpConstructorLinus Groh
2022-10-16LibJS: Implement the RegExpAlloc AOLinus Groh
2022-10-16LibJS: Fix TemporalCalendarString ambiguityLinus Groh
This is a normative change in the Temporal spec. See: - https://github.com/tc39/proposal-temporal/commit/278d238 - https://github.com/tc39/proposal-temporal/commit/b73aea7
2022-10-16LibJS: Rename Get{IANA => Named}TimeZonePreviousTransitionLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/6b759d1
2022-10-16LibJS: Rename Get{IANA => Named}TimeZoneNextTransitionLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/4b0246a
2022-10-16LibJS: Change dateAdd to a required parameter of MoveRelativeDateIdan Horowitz
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/45d9079
2022-10-16LibJS: Add dateAdd to all remaining MoveRelativeDate callsIdan Horowitz
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/a48838a
2022-10-16LibJS: Add optional dateAdd parameter to MoveRelativeDateIdan Horowitz
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/891060f
2022-10-16LibJS: Add fast path TimeZone conversion to PlainDate#toZonedDateTimeLuke Wilde
This is a normative chane in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/fcab1af