From ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Wed, 4 Sep 2019 23:01:07 +0300 Subject: perf_hooks: ignore duplicated entries in observer PerformanceObserver should add to observing only unique entry types. PR-URL: https://github.com/nodejs/node/pull/29442 Reviewed-By: David Carlier Reviewed-By: Minwoo Jung --- lib/perf_hooks.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/perf_hooks.js') diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 1bf635790e..12909b047c 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -354,6 +354,7 @@ class PerformanceObserver extends AsyncResource { for (var n = 0; n < entryTypes.length; n++) { const entryType = entryTypes[n]; const list = getObserversList(entryType); + if (this[kTypes][entryType]) continue; const item = { obs: this }; this[kTypes][entryType] = item; L.append(list, item); -- cgit v1.2.3