feat(builtins): implement JsWeakMap safe wrapper#4738
Merged
jedel1043 merged 3 commits intoboa-dev:mainfrom Feb 27, 2026
Merged
feat(builtins): implement JsWeakMap safe wrapper#4738jedel1043 merged 3 commits intoboa-dev:mainfrom
jedel1043 merged 3 commits intoboa-dev:mainfrom
Conversation
Test262 conformance changes
|
This was referenced Feb 26, 2026
jedel1043
reviewed
Feb 26, 2026
jedel1043
requested changes
Feb 27, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4738 +/- ##
==========================================
+ Coverage 47.24% 57.23% +9.99%
==========================================
Files 476 551 +75
Lines 46892 60466 +13574
==========================================
+ Hits 22154 34610 +12456
- Misses 24738 25856 +1118 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Hi @jedel1043! Thank you for the quick reviews and guidance on #4738 really appreciated the clear feedback. |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 28, 2026
Implements `JsWeakSet` as a safe Rust wrapper around the ECMAScript `WeakSet` builtin, as part of #2098. ## Changes - `core/engine/src/object/builtins/jsweakset.rs` — new `JsWeakSet` wrapper with all methods - `core/engine/src/object/builtins/mod.rs` — registered and re-exported `JsWeakSet` - `examples/src/bin/jsweakset.rs` — usage example ## Methods implemented - `new` — creates an empty WeakSet - `add` — adds an object to the set - `has` — checks if an object exists - `delete` — removes an object - `from_object` — converts `JsObject` to `JsWeakSet` Follows the same pattern as `JsWeakMap` (#4738) and `JsSet`. Closes part of #2098
akash-R-A-J
pushed a commit
to akash-R-A-J/boa
that referenced
this pull request
Mar 1, 2026
Implements `JsWeakMap` as a safe Rust wrapper around the ECMAScript `WeakMap` builtin, as part of boa-dev#2098. ## Changes - `core/engine/src/object/builtins/jsweakmap.rs` — new `JsWeakMap` wrapper with all methods - `core/engine/src/object/builtins/mod.rs` — registered and re-exported `JsWeakMap` - `examples/src/bin/jsweakmap.rs` — usage example ## Methods implemented - `new` — creates an empty WeakMap - `get` — retrieves value by key - `set` — inserts a key-value pair - `has` — checks key existence - `delete` — removes a key - `get_or_insert` — upsert with default value - `get_or_insert_computed` — upsert with callback - `from_object` — converts `JsObject` to `JsWeakMap` Follows the same pattern as `JsMap` and `JsSet`. Closes part of boa-dev#2098
akash-R-A-J
pushed a commit
to akash-R-A-J/boa
that referenced
this pull request
Mar 1, 2026
Implements `JsWeakSet` as a safe Rust wrapper around the ECMAScript `WeakSet` builtin, as part of boa-dev#2098. ## Changes - `core/engine/src/object/builtins/jsweakset.rs` — new `JsWeakSet` wrapper with all methods - `core/engine/src/object/builtins/mod.rs` — registered and re-exported `JsWeakSet` - `examples/src/bin/jsweakset.rs` — usage example ## Methods implemented - `new` — creates an empty WeakSet - `add` — adds an object to the set - `has` — checks if an object exists - `delete` — removes an object - `from_object` — converts `JsObject` to `JsWeakSet` Follows the same pattern as `JsWeakMap` (boa-dev#4738) and `JsSet`. Closes part of boa-dev#2098
ashddev
pushed a commit
to ashddev/boa
that referenced
this pull request
Mar 2, 2026
Implements `JsWeakMap` as a safe Rust wrapper around the ECMAScript `WeakMap` builtin, as part of boa-dev#2098. ## Changes - `core/engine/src/object/builtins/jsweakmap.rs` — new `JsWeakMap` wrapper with all methods - `core/engine/src/object/builtins/mod.rs` — registered and re-exported `JsWeakMap` - `examples/src/bin/jsweakmap.rs` — usage example ## Methods implemented - `new` — creates an empty WeakMap - `get` — retrieves value by key - `set` — inserts a key-value pair - `has` — checks key existence - `delete` — removes a key - `get_or_insert` — upsert with default value - `get_or_insert_computed` — upsert with callback - `from_object` — converts `JsObject` to `JsWeakMap` Follows the same pattern as `JsMap` and `JsSet`. Closes part of boa-dev#2098
ashddev
pushed a commit
to ashddev/boa
that referenced
this pull request
Mar 2, 2026
Implements `JsWeakSet` as a safe Rust wrapper around the ECMAScript `WeakSet` builtin, as part of boa-dev#2098. ## Changes - `core/engine/src/object/builtins/jsweakset.rs` — new `JsWeakSet` wrapper with all methods - `core/engine/src/object/builtins/mod.rs` — registered and re-exported `JsWeakSet` - `examples/src/bin/jsweakset.rs` — usage example ## Methods implemented - `new` — creates an empty WeakSet - `add` — adds an object to the set - `has` — checks if an object exists - `delete` — removes an object - `from_object` — converts `JsObject` to `JsWeakSet` Follows the same pattern as `JsWeakMap` (boa-dev#4738) and `JsSet`. Closes part of boa-dev#2098
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
JsWeakMapas a safe Rust wrapper around the ECMAScriptWeakMapbuiltin, as part of #2098.Changes
core/engine/src/object/builtins/jsweakmap.rs— newJsWeakMapwrapper with all methodscore/engine/src/object/builtins/mod.rs— registered and re-exportedJsWeakMapexamples/src/bin/jsweakmap.rs— usage exampleMethods implemented
new— creates an empty WeakMapget— retrieves value by keyset— inserts a key-value pairhas— checks key existencedelete— removes a keyget_or_insert— upsert with default valueget_or_insert_computed— upsert with callbackfrom_object— convertsJsObjecttoJsWeakMapFollows the same pattern as
JsMapandJsSet.Closes part of #2098