diff --git a/src/preamble.js b/src/preamble.js index ad0d001507b72..cc60738319ef1 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -75,6 +75,11 @@ var ABORT = false; // but only when noExitRuntime is false. var EXITSTATUS; +#if ASSERTIONS || !STRICT +// In STRICT mode we only define assert() and ASSERTIONS is set. i.e. we don't +// define it at all in release modes. This matches the behaviour of +// MINIMAL_RUNTIME. +// TODO(sbc): Make this the default even without STRICT. /** @type {function(*, string=)} */ function assert(condition, text) { if (!condition) { @@ -88,6 +93,7 @@ function assert(condition, text) { #endif } } +#endif #if ASSERTIONS // We used to include malloc/free by default in the past. Show a helpful error in