Skip to content

Commit 4cc95a5

Browse files
committed
load heap_profile module in worker
1 parent f39064b commit 4cc95a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/worker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ const {
7171
validateObject,
7272
validateNumber,
7373
} = require('internal/validators');
74-
const {
75-
normalizeHeapProfileOptions,
76-
} = require('internal/v8/heap_profile');
74+
let normalizeHeapProfileOptions;
7775
const {
7876
throwIfBuildingSnapshot,
7977
} = require('internal/v8/startup_snapshot');
@@ -600,6 +598,8 @@ class Worker extends EventEmitter {
600598
* @returns {Promise}
601599
*/
602600
startHeapProfile(options) {
601+
normalizeHeapProfileOptions ??=
602+
require('internal/v8/heap_profile').normalizeHeapProfileOptions;
603603
const { sampleInterval, stackDepth, flags } =
604604
normalizeHeapProfileOptions(options);
605605
const startTaker = this[kHandle]?.startHeapProfile(

0 commit comments

Comments
 (0)