MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / assert

Function assert

src/preamble.js:68–79  ·  view source on GitHub ↗

@type {function(*, string=)}

(condition, text)

Source from the content-addressed store, hash-verified

66// TODO(sbc): Make this the default even without STRICT enabled.
67/** @type {function(*, string=)} */
68function assert(condition, text) {
69 if (!condition) {
70#if ASSERTIONS
71 abort('Assertion failed' + (text ? ': ' + text : ''));
72#else
73 // This build was created without ASSERTIONS defined. `assert()` should not
74 // ever be called in this configuration but in case there are callers in
75 // the wild leave this simple abort() implementation here for now.
76 abort(text);
77#endif
78 }
79}
80#endif
81
82#if ASSERTIONS

Callers 15

onSbrkGrowFunction · 0.70
onMallocFunction · 0.70
shell.jsFile · 0.70
postlibrary.jsFile · 0.70
writeStackCookieFunction · 0.70
initMemoryFunction · 0.70
node_shell_read.jsFile · 0.70
localFileFunction · 0.70
stopMethod · 0.70
constructorMethod · 0.70
audio_worklet.jsFile · 0.70

Calls 1

abortFunction · 0.70

Tested by 1

readMethod · 0.40