MCPcopy
hub / github.com/magcius/noclip.website / assert

Function assert

src/gfx/platform/GfxPlatformUtil.ts:4–9  ·  view source on GitHub ↗
(b: boolean, message: string = "")

Source from the content-addressed store, hash-verified

2// Copied from toplevel util.ts
3
4export function assert(b: boolean, message: string = ""): asserts b {
5 if (!b) {
6 console.error(new Error().stack);
7 throw new Error(`Assert fail: ${message}`);
8 }
9}
10
11export function assertExists<T>(v: T | null | undefined): T {
12 if (v !== undefined && v !== null)

Callers 15

extractor.tsFile · 0.90
createBindingLayoutsFunction · 0.70
_programCompiledMethod · 0.70
createBufferMethod · 0.70
_createTextureMethod · 0.70
createSamplerMethod · 0.70
createBindingsMethod · 0.70
createInputLayoutMethod · 0.70
createRenderPassMethod · 0.70
submitPassMethod · 0.70
copySubTexture2DMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected