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

Function getClassBase

lib/internal/util/inspect.js:1551–1570  ·  view source on GitHub ↗
(value, constructor, tag)

Source from the content-addressed store, hash-verified

1549}
1550
1551function getClassBase(value, constructor, tag) {
1552 const hasName = ObjectPrototypeHasOwnProperty(value, 'name');
1553 const name = (hasName && value.name) || '(anonymous)';
1554 let base = `class ${name}`;
1555 if (constructor !== 'Function' && constructor !== null) {
1556 base += ` [${constructor}]`;
1557 }
1558 if (tag !== '' && constructor !== tag) {
1559 base += ` [${tag}]`;
1560 }
1561 if (constructor !== null) {
1562 const superName = ObjectGetPrototypeOf(value).name;
1563 if (superName) {
1564 base += ` extends ${superName}`;
1565 }
1566 } else {
1567 base += ' extends [null prototype]';
1568 }
1569 return `[${base}]`;
1570}
1571
1572function getFunctionBase(ctx, value, constructor, tag) {
1573 const stringified = FunctionPrototypeToString(value);

Callers 1

getFunctionBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…