diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index c2b31f55cda..7429db38fd7 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -52,7 +52,6 @@ const { NODE_PERFORMANCE_MILESTONE_ENVIRONMENT } = constants; -const { AsyncResource } = require('async_hooks'); const L = require('internal/linkedlist'); const kInspect = require('internal/util').customInspectSymbol; @@ -340,12 +339,11 @@ class PerformanceObserverEntryList { } } -class PerformanceObserver extends AsyncResource { +class PerformanceObserver { constructor(callback) { if (typeof callback !== 'function') { throw new ERR_INVALID_CALLBACK(callback); } - super('PerformanceObserver'); ObjectDefineProperties(this, { [kTypes]: { enumerable: false, @@ -553,10 +551,7 @@ function getObserversList(type) { function doNotify(observer) { observer[kQueued] = false; - observer.runInAsyncScope(observer[kCallback], - observer, - observer[kBuffer], - observer); + observer[kCallback](observer[kBuffer], observer); observer[kBuffer][kEntries] = []; L.init(observer[kBuffer][kEntries]); }