node/test/fixtures/klass-with-fields.js
Joyee Cheung b872d30d19
lib: add options to the heap snapshot APIs
Support configuration of the HeapSnapshotMode and NumericsMode
fields inf HeapSnapshotOptions in the JS APIs for heap snapshots.

PR-URL: https://github.com/nodejs/node/pull/44989
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-11-08 16:19:54 +01:00

19 lines
266 B
JavaScript

'use strict';
const {
parentPort,
isMainThread
} = require('node:worker_threads');
class Klass {
numeric = 1234;
nonNumeric = 'test';
}
globalThis.obj = new Klass();
if (!isMainThread) {
parentPort.postMessage('ready');
setInterval(() => {}, 100);
}