-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mark Set, Map, WeakSet and WeakMap with array arguments as pure (…
…#5005) Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
- Loading branch information
1 parent
6d78dea
commit 5ea3655
Showing
4 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = defineTest({ | ||
description: 'retain Set, Map, WeakSet and WeakMap which called with array arguments' | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
new Set([f()]); //retained | ||
|
||
new WeakSet([f()]); //retained | ||
|
||
new Map([['a', f()]]); //retained | ||
|
||
new WeakMap([[f(), 'a']]); //retained |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
new Set([f()]); //retained | ||
|
||
new Set(['a']); | ||
|
||
new Set(); | ||
|
||
new WeakSet([f()]); //retained | ||
|
||
new WeakSet([{}]); | ||
|
||
new WeakSet(); | ||
|
||
new Map([['a', f()]]); //retained | ||
|
||
new Map([['a', 'a']]); | ||
|
||
new Map(); | ||
|
||
new WeakMap([[f(), 'a']]); //retained | ||
|
||
new WeakMap([[{}, 'a']]); | ||
|
||
new WeakMap(); |