summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
AgeCommit message (Collapse)Author
2023-06-02LibJS: Store PrivateElement values in Handle<Value>Andreas Kling
This fixes an issue where private element values were not always protected from GC. I found two instances where this was happening: - ECMAScriptFunctionObject did not mark m_private_methods - ClassDefinitionEvaluation had two Vector<PrivateElement> that were opaque to the garbage collector, and so if GC occurred while constructing a class instance, some or all of its private elements could get incorrectly collected.
2023-05-30LibJS: Align MathObject::atan closer to specShannon Booth
This is not an observable difference. Nonetheless, it seems like a good idea to be as close to the spec as possible, so let's do that.
2023-05-30LibJS: Add spec comments to MathObject::atanShannon Booth
2023-05-28LibJS: Fix reading cached source rangesMacDue
Made a slight logic error in 95d69fc which meant the dummy range would be returned even if the source_range_storage contained an actual source range. This corrects that by resolving the null unrealized range to a dummy range, and storing that. It then can be treated as a normal source range.
2023-05-28LibJS: Fix crash when trying to get source rangeMacDue
Previously, source_range() could crash attempting to read from a null unrealized->source_code pointer. It looks like the previous behaviour here was to return a dummy source range, so this commit restores that. With this loading https://github.com/SerenityOS/serenity works again.
2023-05-28LibJS: Make Error stack traces lazierAndreas Kling
Instead of eagerly populating the stack trace with a textual representation of every call frame, just store the raw source code range (code, start offset, end offset). From that, we can generate the full rich backtrace when requested, and save ourselves the trouble otherwise. This makes test-wasm take ~7 seconds on my machine instead of ~60. :^)
2023-05-27LibJS/Runtime: Use `Core::File` in `VM::resolve_imported_module`Lucas CHOLLET
2023-05-26LibJS: Disallow creating ArrayBuffers larger than 2^53 - 1Timothy Flynn
This is a normative change in the ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/25f9744
2023-05-26LibJS: Update spec numbers for the Well-Formed Unicode Strings proposalTimothy Flynn
This proposal has been merged into the main ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/d95f42d
2023-05-24Userland: Remove remaining users of Duration::now_realtime()kleines Filmröllchen
This is a clear sign that they want to use a UnixDateTime instead. This also adds support for placing durations and date times into SQL databases via their millisecond offset to UTC.
2023-05-24LibTimeZone+Userland: Change timezone functions to use UnixDateTimekleines Filmröllchen
This incurs a whole host of changes in, among others, JavaScript Intl and Date.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-22LibJS: Add "Month dd, yy hh:mm:ss" Date formatLuke Wilde
Required by Discord's Birthday page.
2023-05-21LibJS: Don't dereference well-known symbols when gathering rootsAndreas Kling
This fixes an issue where very early GC would crash trying to dereference not-yet-initialized entries in the well-known symbol set.
2023-05-21LibWeb+LibJS: Don't lazily construct web prototypes in cell constructorsAndreas Kling
It's not safe to allocate from the GC heap while in the constructor of a GC heap cell. (Because if this ends up triggering a collection, we may end up trying to call through an uninitialized vtable). This was already done safely in the initialize() virtual in much of LibJS and LibWeb. This patch moves the logic for prototypes, mixins, and CSSStyleDeclaration as well. Fixes a long-standing GC crash that was pretty easy to reproduce by refreshing https://vercel.com/
2023-05-06LibJS: Guard against stack overflow in ProxyObject set_property()Maciej
For similar reason as in the previous commit.
2023-05-06LibJS: Guard against stack overflow in ProxyObject has_property()Maciej
If proxy has an undefined trap, it will fallback to target's internal_has_property, which will then check target's prototype for the requested property. If Proxy's prototype is set to the Proxy itself, it will check in itself in a loop, causing a stack overflow.
2023-04-30LibJS+LibWeb: Explicitly mark ignored members in visit_edges methodsMatthew Olsson
2023-04-30LibJS+LibWeb: Add missing visit calls in visit_edges implementationsMatthew Olsson
2023-04-30LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objectsMatthew Olsson
2023-04-21LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacksSam Atkins
This automatically protects captured objects from being GC'd before the callback runs.
2023-04-15LibJS: Port create_iterator_result_object() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Port iterator_step() to GCPtrLinus Groh
2023-04-15LibJS: Port iterator_next() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Port this_symbol_value() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Port this_string_value() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Port this_bigint_value() to NonnullGCPtrLinus Groh
2023-04-15LibJS: Add remaining missing spec comments to StringPrototypeLinus Groh
The changes from ac2f109 were from an old branch, which either had a rebase accident or was simply incomplete. Should be complete now :^)
2023-04-15LibJS: Add spec comments to StringPrototypeLinus Groh
2023-04-15LibJS: Add spec comments to StringObjectLinus Groh
2023-04-15LibJS: Add spec comments to ProxyConstructorLinus Groh
2023-04-15LibJS: Add spec comments to ObjectPrototypeLinus Groh
2023-04-15LibJS: Add spec comments to ObjectConstructorLinus Groh
2023-04-15LibJS: Add spec comments to ObjectLinus Groh
2023-04-15LibJS: Add spec comments to NumberConstructorLinus Groh
2023-04-15LibJS: Add spec comments to MathObjectLinus Groh
2023-04-15LibJS: Add spec comments to MapPrototypeLinus Groh
2023-04-15LibJS: Add spec comments to GlobalObjectLinus Groh
2023-04-14LibJS: Port PrototypeObject::typed_this_value() to NonnullGCPtrLinus Groh
2023-04-14LibJS: Port PrototypeObject::typed_this_object() to NonnullGCPtrLinus Groh
2023-04-14LibJS: Port PrototypeObject::this_object() to NonnullGCPtrLinus Groh
2023-04-14LibJS: Port Value::get_method() to GCPtrLinus Groh
2023-04-14LibJS: Port Value::to_bigint() to NonnullGCPtrLinus Groh
2023-04-14LibJS: Port Value::to_object() to NonnullGCPtrLinus Groh
2023-04-14LibJS: Port Value::to_primitive_string() to NonnullGCPtrLinus Groh
2023-04-13LibJS: Make well-known symbol getters return NonnullGCPtrLinus Groh
None of these are ever null after the VM has been initialized, as proved by virtually every caller immediately dereferencing the raw pointer.
2023-04-13LibJS: Make intrinsics getters return NonnullGCPtrLinus Groh
Some of these are allocated upon initialization of the intrinsics, and some lazily, but in neither case the getters actually return a nullptr. This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has an `operator T&()`), and also has the interesting side effect of forcing us to explicitly use the FunctionObject& overload of call(), as passing a NonnullGCPtr is ambigous - it could implicitly be turned into a Value _or_ a FunctionObject& (so we have to dereference manually).
2023-04-13LibJS: Add spec comments to WeakSetPrototypeLinus Groh
2023-04-13LibJS: Add spec comments to WeakSetConstructorLinus Groh
2023-04-13LibJS: Add spec comments to WeakRefPrototypeLinus Groh