summaryrefslogtreecommitdiff
path: root/lib/perf_hooks.js
diff options
context:
space:
mode:
authorKirill Fomichev <fanatid@ya.ru>2019-09-04 23:01:07 +0300
committerRich Trott <rtrott@gmail.com>2019-09-07 07:04:19 -0700
commitef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614 (patch)
tree85499d4556af71392e2f889b26619aa8d4e74f5f /lib/perf_hooks.js
parent6d01f1fa41947dc2ea087611ed443616b757fef8 (diff)
downloadandroid-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.tar.gz
android-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.tar.bz2
android-node-v8-ef9ecfbcfe8a5b1e8b1c601c48afa065cbdab614.zip
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 <devnexen@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'lib/perf_hooks.js')
-rw-r--r--lib/perf_hooks.js1
1 files changed, 1 insertions, 0 deletions
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);