summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Set.h
AgeCommit message (Collapse)Author
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-23LibJS+LibWeb: Replace GlobalObject with Realm in create() functionsLinus Groh
This is a continuation of the previous two commits. As allocating a JS cell already primarily involves a realm instead of a global object, and we'll need to pass one to the allocate() function itself eventually (it's bridged via the global object right now), the create() functions need to receive a realm as well. The plan is for this to be the highest-level function that actually receives a realm and passes it around, AOs on an even higher level will use the "current realm" concept via VM::current_realm() as that's what the spec assumes; passing around realms (or global objects, for that matter) on higher AO levels is pointless and unlike for allocating individual objects, which may happen outside of regular JS execution, we don't need control over the specific realm that is being used there.
2022-03-16Libraries: Use default constructors/destructors in LibJSLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-02-09LibJS: Implement Sets using MapsAli Mohammad Pur
This implements ordered sets using Maps with a sentinel value, and includes some extra set tests. Fixes #11004. Co-Authored-By: davidot <davidot@serenityos.org>
2021-06-15LibJS: Use OrderedHashTable instead of HashTable in the Set built-inIdan Horowitz
This ensures insertion-order iteration.
2021-06-13LibJS: Move ValueTraits to Value.h and add special case for -0.0Idan Horowitz
This will allow us to use these traits for other hash-based containers (like Map). This commit also adds a special case for negative zero values, because while the equality check used same_value_zero which is negative/positive zero insensitive, the hash was not.
2021-06-09LibJS: Stop inheriting from Set in SetPrototypeIdan Horowitz
This makes sure that is<Set> checks done on the Set prototype instead of on Set instances return false, thereby emulating the behaviour of the RequireInternalSlot abstract operation.
2021-06-09LibJS: Mark heap cell values stored in Set instancesIdan Horowitz
This makes sure they dont get garbage collected while stored in a Set.
2021-06-09LibJS: Add the Set built-in objectIdan Horowitz