diff options
Diffstat (limited to 'lib/perf_hooks.js')
-rw-r--r-- | lib/perf_hooks.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 18b0332fea..ac4fc405c5 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -1,6 +1,10 @@ 'use strict'; -const { Object } = primordials; +const { + ObjectDefineProperties, + ObjectDefineProperty, + ObjectKeys, +} = primordials; const { ELDHistogram: _ELDHistogram, @@ -215,7 +219,7 @@ const nodeTiming = new PerformanceNodeTiming(); // Maintains a list of entries as a linked list stored in insertion order. class PerformanceObserverEntryList { constructor() { - Object.defineProperties(this, { + ObjectDefineProperties(this, { [kEntries]: { writable: true, enumerable: false, @@ -280,7 +284,7 @@ class PerformanceObserver extends AsyncResource { throw new ERR_INVALID_CALLBACK(callback); } super('PerformanceObserver'); - Object.defineProperties(this, { + ObjectDefineProperties(this, { [kTypes]: { enumerable: false, writable: true, @@ -312,7 +316,7 @@ class PerformanceObserver extends AsyncResource { disconnect() { const observerCountsGC = observerCounts[NODE_PERFORMANCE_ENTRY_TYPE_GC]; const types = this[kTypes]; - const keys = Object.keys(types); + const keys = ObjectKeys(types); for (var n = 0; n < keys.length; n++) { const item = types[keys[n]]; if (item) { @@ -413,13 +417,13 @@ class Performance { if (fn[kTimerified]) return fn[kTimerified]; const ret = timerify(fn, fn.length); - Object.defineProperty(fn, kTimerified, { + ObjectDefineProperty(fn, kTimerified, { enumerable: false, configurable: true, writable: false, value: ret }); - Object.defineProperties(ret, { + ObjectDefineProperties(ret, { [kTimerified]: { enumerable: false, configurable: true, @@ -610,7 +614,7 @@ module.exports = { monitorEventLoopDelay }; -Object.defineProperty(module.exports, 'constants', { +ObjectDefineProperty(module.exports, 'constants', { configurable: false, enumerable: true, value: constants |