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

Function mustNotCall

test/common/index.js:562–571  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

560}
561
562function mustNotCall(msg) {
563 const callSite = getCallSites()[1];
564 return function mustNotCall(...args) {
565 const argsInfo = args.length > 0 ?
566 `\ncalled with arguments: ${args.map((arg) => inspect(arg)).join(', ')}` : '';
567 assert.fail(
568 `${msg || 'function should not have been called'} at ${callSite.scriptName}:${callSite.lineNumber}` +
569 argsInfo);
570 };
571}
572
573const _mustNotMutateObjectDeepProxies = new WeakMap();
574

Calls 5

getCallSitesFunction · 0.85
mapMethod · 0.65
inspectFunction · 0.50
joinMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…