MCPcopy Index your code
hub / github.com/nodejs/node / [customInspectSymbol]

Method [customInspectSymbol]

lib/internal/vm/module.js:239–260  ·  view source on GitHub ↗
(depth, options)

Source from the content-addressed store, hash-verified

237 }
238
239 [customInspectSymbol](depth, options) {
240 validateThisInternalField(this, kWrap, 'Module');
241 if (typeof depth === 'number' && depth < 0)
242 return this;
243
244 const constructor = getConstructorOf(this) || Module;
245 const o = { __proto__: { constructor } };
246 o.status = this.status;
247 o.identifier = this.identifier;
248 o.context = this.context;
249
250 ObjectSetPrototypeOf(o, ObjectGetPrototypeOf(this));
251 ObjectDefineProperty(o, SymbolToStringTag, {
252 __proto__: null,
253 value: constructor.name,
254 configurable: true,
255 });
256
257 // Lazy to avoid circular dependency
258 const { inspect } = require('internal/util/inspect');
259 return inspect(o, { ...options, customInspect: false });
260 }
261}
262
263const kNoError = Symbol('kNoError');

Callers

nothing calls this directly

Calls 3

getConstructorOfFunction · 0.85
requireFunction · 0.50
inspectFunction · 0.50

Tested by

no test coverage detected