summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
AgeCommit message (Collapse)Author
2022-09-06LibWeb+LibJS: Let JS::Realm::HostDefined objects mark things during GCAndreas Kling
This allows us to mark the HTML::Window from our window environment settings object.
2022-09-05LibLocale: Move locale source files to the LibLocale folderTimothy Flynn
These are still included in LibUnicode, but this updates their location and the include paths of other files which include them.
2022-09-05Userland: Move files destined for LibLocale to the Locale namespaceTimothy Flynn
2022-09-05LibUnicode+LibJS: Move Unicode::get_available_currencies() to Locale.hTimothy Flynn
This is generated by GenerateLocaleData, which will soon be in the Locale namespace. Move it out of CurrencyCode.h, as that will continue to live in the Unicode namespace.
2022-09-05LibJS: Remove unused include from JS::Temporal::CalendarTimothy Flynn
2022-09-03LibJS: Don't use a Handle<Realm> in FinalizationRegistryAndreas Kling
Instead just treat it like a normal GC cell edge.
2022-09-02LibJS: Fix incorrect check in ValidateAndApplyPropertyDescriptorLinus Groh
This is an editorial change in the ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/f0e4ae8
2022-09-02LibJS: Assert Proxy target is a function in [[Call]] and [[Construct]]Linus Groh
As the TODOs suggested for a long time. :^)
2022-09-02LibJS: Make indirect bindings of module behave like normal bindingsdavidot
Before this we attempted to hack around this by only overriding has_binding. However this did not cover all cases, for example when assigning to variables before their declaration it didn't throw. By using the new find_binding_and_index virtual method we can just pretend the indirect bindings are real. Since indirect binding do come from a normal environment we need to ensure you cannot modify the binding and that properties like mutable are false as expected by the spec for such an indirect binding.
2022-09-02LibJS: Make DeclarativeEnvironment based on bindings instead of indicesdavidot
This will allow other environments which extend DeclarativeEnvironment to provide their own custom bindings.
2022-09-02LibJS: Put exports before symbols in keys of module namespace objectdavidot
2022-09-02LibJS: Call resolve instead of reject in AsyncFromSyncIteratorPrototypedavidot
2022-08-30LibJS: Create DurationFormat's ListFormat object with type and styleTimothy Flynn
This is a normative change in the Intl.DurationFormat spec. See: https://github.com/tc39/proposal-intl-duration-format/commit/1304e4b
2022-08-30LibJS: Use numeric style if the previous style was numeric or 2-digitTimothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/3a46ee3
2022-08-30LibJS: Update DurationFormat AO text to align with ECMA-402 and TemporalTimothy Flynn
These are editorial changes in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/71b291b https://github.com/tc39/proposal-intl-duration-format/commit/d0cc6fa https://github.com/tc39/proposal-intl-duration-format/commit/d4b35bb
2022-08-30LibJS: Rename DurationFormat's DurationSign to DurationRecordSignTimothy Flynn
This is an editorial change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/f947239
2022-08-30LibJS: Align ToDurationRecord with ToTemporalDurationRecordTimothy Flynn
This is an editorial change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/527ea58
2022-08-30LibJS: Mark PartitionDurationFormatPattern as infallibleTimothy Flynn
This is an editorial change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/cea3b68
2022-08-30LibJS: Change GetDurationUnitOptions to require a string for prevStyleTimothy Flynn
This is an editoral change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/62ee645
2022-08-30LibJS: Resolve FIXMEs in DurationFormat's PartitionDurationFormatPatternTimothy Flynn
These are normative changes in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/e2e18d1 https://github.com/tc39/proposal-intl-duration-format/commit/f1e8ed3 https://github.com/tc39/proposal-intl-duration-format/commit/2ed31b8 https://github.com/tc39/proposal-intl-duration-format/commit/2d51d64 https://github.com/tc39/proposal-intl-duration-format/commit/64cc5db https://github.com/tc39/proposal-intl-duration-format/commit/a1d7876 https://github.com/tc39/proposal-intl-duration-format/commit/47a3a69 https://github.com/tc39/proposal-intl-duration-format/commit/3e9358e https://github.com/tc39/proposal-intl-duration-format/commit/f4ecb46 https://github.com/tc39/proposal-intl-duration-format/commit/b454c8c
2022-08-30LibJS: Default to "short" for DurationFormat's style optionTimothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/b289494
2022-08-30LibJS: Default to 0 for DurationFormat's fractionalDigits optionTimothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/ac7e184
2022-08-30LibJS: Update spec steps to validate DurationFormat's numberingSystemTimothy Flynn
This is a normative change in the Intl.DurationFormat proposal. See: https://github.com/tc39/proposal-intl-duration-format/commit/63a9202
2022-08-30LibJS: Make string_to_bigint() a standalone functionLinus Groh
This now matches the newly added string_to_number().
2022-08-30LibJS: Trim non-ASCII whitespace as well in StringToBigIntLinus Groh
This was never caught since the original implementation AFAICT, and isn't being covered by test262 either: https://github.com/tc39/test262/issues/1354
2022-08-30LibJS: Trim non-ASCII whitespace as well in StringToNumberLinus Groh
This regressed in f4b3bb5.
2022-08-30LibJS: Handle non-decimal integer literals in Value::to_numberSlappy826
Implements support for parsing binary and octal literals, and fixes instances where a hex literal is parsed in ways the spec doesn't allow.
2022-08-29LibJS: Hide all the constructors!Andreas Kling
Now that the GC allocator is able to invoke Cell subclass constructors directly via friendship, we no longer need to keep them public. :^)
2022-08-29LibJS: Make JS_OBJECT and JS_ENVIRONMENT forward to JS_CELLAndreas Kling
2022-08-29LibJS: Add JS_CELL macro and use it in all JS::Cell subclassesAndreas Kling
This is similar to what we already had with JS_OBJECT (and also JS_ENVIRONMENT) but sits at the top of the Cell inheritance hierarchy.
2022-08-28LibJS: Implement ShadowRealmConstructor::construct() closer to specLinus Groh
Defer creation of the global object to Realm::set_global_object(), and use the newly added set_default_global_bindings() AO as intended.
2022-08-28LibJS: Implement SetDefaultGlobalBindings as a standalone functionLinus Groh
Instead of hardcoding all the property definitions in GlobalObject's initialize() function, make it the standalone AO it is supposed to be that can then be used by other global objects that don't inherit from JS::GlobalObject.
2022-08-28LibJS: Move construction of GlobalObject native functions to IntrinsicsLinus Groh
This will later allow global objects not inheriting from the regular JS::GlobalObject to pull in these functions without having to implement them from scratch. The primary use case here is, again, a wrapper-less HTML::Window in LibWeb :^) Allocating these upfront now allows us to get rid of two hacks: - The GlobalObject assigning Intrinsics private members after finishing its initialization - The GlobalObject defining the parseInt and parseFloat properties of the NumberConstructor object, as they are supposed to be identical with the global functions of the same name
2022-08-28LibJS+LibWeb: Let Realm store a plain Object for [[GlobalObject]]Linus Groh
This removes the requirement of having a global object that actually inherits from JS::GlobalObject, which is now a perfectly valid scenario. With the upcoming removal of wrapper objects in LibWeb, the HTML::Window object will inherit from DOM::EventTarget, which means it cannot also inherit from JS::GlobalObject.
2022-08-28LibJS: Remove Shape::global_object() and Object::global_object()Linus Groh
Same reason as in commit 275dea9.
2022-08-28LibJS: Let NewGlobalEnvironment take a plain ObjectLinus Groh
The object is passed directly to NewObjectEnvironment, which has no requirement for this being a JS::GlobalObject. This is needed for the next change, which will make Realm store a plain Object as for the global object as well.
2022-08-28LibJS: Turn initialize_global_object() into a regular initialize()Linus Groh
There's nothing special about global object initialization anymore, this can just work the same way as for any other object now.
2022-08-28LibJS: Move Console ownership from GlobalObject to ConsoleObjectLinus Groh
GlobalObject is now a regular object with no special properties :^)
2022-08-28LibJS: Move ConsoleObject construction from GlobalObject to IntrinsicsLinus Groh
This will allow us to move the underlying console from GlobalObject to ConsoleObject without still having to do a 'console' property lookup on the GlobalObject.
2022-08-28LibJS: Remove Console's reliance on GlobalObjectLinus Groh
This was not being used for anything meaningful, just store a reference to the VM directly.
2022-08-27LibJS+LibUnicode: Move some constant arrays to a separate headerdavidot
Since LibUnicode depends on this data it used to include Intl/AbstractOperations which in turn includes a number of other LibJS headers. By moving this to its own header with minimal includes we can save on rebuilding LibUnicode for unrelated LibJS header changes.
2022-08-27LibJS: Remove GlobalObject::{set_,}associated_realm()Linus Groh
2022-08-27LibJS+LibWeb: Remove last uses of GlobalObject::associated_realm()Linus Groh
2022-08-27LibJS: Move intrinsics to the realmLinus Groh
Intrinsics, i.e. mostly constructor and prototype objects, but also things like empty and new object shape now live on a new heap-allocated JS::Intrinsics object, thus completing the long journey of taking all the magic away from the global object. This represents the Realm's [[Intrinsics]] slot in the spec and matches its existing [[GlobalObject]] / [[GlobalEnv]] slots in terms of architecture. In the majority of cases it should now be possibly to fully allocate a regular object without the global object existing, and in fact that's what we do now - the realm is allocated before the global object, and the intrinsics between both :^)
2022-08-26LibJS: Remove now unnecessary i32 casts when constructing BigIntegersdavidot
2022-08-26LibCrypto+LibJS: Remove the create_from methods from BigIntegerdavidot
Instead we just use a specific constructor. With this set of constructors using curly braces for constructing is highly recommended. As then it will not do too many implicit conversions which could lead to unexpected loss of data or calling the much slower double constructor. Also to ensure we don't feed (Un)SignedBigInteger infinities we throw RangeError earlier for Durations.
2022-08-26LibJS: Use the proper to_double method in NumberConstructordavidot
2022-08-25LibJS: Allow undefined for calendar in MaybeFormatCalendarAnnotationLinus Groh
This is an editorial change in the Temporal spec. Now that this is spec'd as either an Object or undefined, we can change the parameter type from arbitrary JS::Value to JS::Object*. See: https://github.com/tc39/proposal-temporal/commit/cdfcffd
2022-08-25LibJS: Use fully spec'd algorithm for ToISOWeekOfYearLinus Groh
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/33b62a3
2022-08-25LibJS: Reject ambiguous time string even with a calendarLinus Groh
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/5e2afb9