MCPcopy
hub / github.com/KilledByAPixel/LittleJS / ASSERT

Function ASSERT

src/engineDebug.js:57–62  ·  view source on GitHub ↗

Asserts if the expression is false, does nothing in release builds * Halts execution if the assert fails and throws an error * @param {boolean} assert * @param {...Object} output - error message output * @memberof Debug

(assert, ...output)

Source from the content-addressed store, hash-verified

55 * @param {...Object} output - error message output
56 * @memberof Debug */
57function ASSERT(assert, ...output)
58{
59 if (assert) return;
60 console.assert(assert, ...output)
61 throw new Error('Assert failed!'); // halt execution
62}
63
64/** Log to console if debug is enabled, does nothing in release builds
65 * @param {...Object} output - message output

Callers 15

keyIsDownFunction · 0.70
keyWasPressedFunction · 0.70
keyWasReleasedFunction · 0.70
keyDirectionFunction · 0.70
mouseIsDownFunction · 0.70
mouseWasPressedFunction · 0.70
mouseWasReleasedFunction · 0.70
gamepadIsDownFunction · 0.70
gamepadWasPressedFunction · 0.70
gamepadWasReleasedFunction · 0.70
gamepadStickFunction · 0.70
gamepadDpadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected