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

Function shouldAssertFunction

test/fixtures/snapshot/typescript.js:2693–2700  ·  view source on GitHub ↗

* Tests whether an assertion function should be executed. If it shouldn't, it is cached and replaced with `ts.noop`. * Replaced assertion functions are restored when `Debug.setAssertionLevel` is set to a high enough level. * @param level The minimum assertion level required.

(level, name)

Source from the content-addressed store, hash-verified

2691 * @param name The name of the current assertion function.
2692 */
2693 function shouldAssertFunction(level, name) {
2694 if (!shouldAssert(level)) {
2695 assertionCache[name] = { level: level, assertion: Debug[name] };
2696 Debug[name] = ts.noop;
2697 return false;
2698 }
2699 return true;
2700 }
2701 function fail(message, stackCrawlMark) {
2702 debugger;
2703 var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");

Callers 6

assertEachNodeFunction · 0.85
assertNodeFunction · 0.85
assertNotNodeFunction · 0.85
assertOptionalNodeFunction · 0.85
assertOptionalTokenFunction · 0.85
assertMissingNodeFunction · 0.85

Calls 1

shouldAssertFunction · 0.85

Tested by

no test coverage detected