MCPcopy Index your code
hub / github.com/nodejs/node / queryObjects

Function queryObjects

lib/internal/heap_utils.js:73–90  ·  view source on GitHub ↗
(ctor, options = kEmptyObject)

Source from the content-addressed store, hash-verified

71 depth: 0,
72};
73function queryObjects(ctor, options = kEmptyObject) {
74 validateFunction(ctor, 'constructor');
75 if (options !== kEmptyObject) {
76 validateObject(options, 'options');
77 }
78 const format = options.format || 'count';
79 if (format !== 'count' && format !== 'summary') {
80 throw new ERR_INVALID_ARG_VALUE('options.format', format);
81 }
82 emitExperimentalWarning('v8.queryObjects()');
83 // Matching the console API behavior - just access the .prototype.
84 const objects = _queryObjects(ctor.prototype);
85 if (format === 'count') {
86 return objects.length;
87 }
88 // options.format is 'summary'.
89 return ArrayPrototypeMap(objects, (object) => inspect(object, inspectOptions));
90}
91
92module.exports = {
93 getHeapSnapshotOptions,

Callers 1

Calls 2

emitExperimentalWarningFunction · 0.85
inspectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…