-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf_hooks: fix PerformanceObserver 'gc' crash
Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: #38412 PR-URL: #38414 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
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,17 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
|
||
// Verifies that setting up two observers to listen | ||
// to gc performance does not crash. | ||
|
||
const { | ||
PerformanceObserver, | ||
} = require('perf_hooks'); | ||
|
||
// We don't actually care if the callback is ever invoked in this test | ||
const obs = new PerformanceObserver(() => {}); | ||
const obs2 = new PerformanceObserver(() => {}); | ||
|
||
obs.observe({ type: 'gc' }); | ||
obs2.observe({ type: 'gc' }); |