diff options
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/preamble.js b/src/preamble.js index 08edb022..4f7fef93 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -37,8 +37,10 @@ START_TIME = Date.now(); function assert(condition, text) { if (!condition) { - print('Assertion failed: ' + text + ':\n' + (new Error).stack); - throw "Assertion"; + var text = "Assertion failed: " + text; + print(text + ':\n' + (new Error).stack); + if (this[alert]) alert(text) + throw "Assertion: " + text; } } @@ -145,10 +147,10 @@ function __initializeRuntime__() { HEAP = intArrayFromString('(null)'); // So printing %s of NULL gives '(null)' // Also this ensures we leave 0 as an invalid address, 'NULL' - if (!this['TOTAL_STATIC']) TOTAL_STATIC = 64*1024; // Reserved room for static allocation + if (!this['TOTAL_STATIC']) TOTAL_STATIC = 64*1024*100; // Reserved room for static allocation STATICROOT = STATICTOP = alignMemoryPage(HEAP.length); - if (!this['TOTAL_STACK']) TOTAL_STACK = 64*1024; // Reserved room for stack + if (!this['TOTAL_STACK']) TOTAL_STACK = 64*1024*10; // Reserved room for stack STACK_STACK = []; STACKROOT = STACKTOP = alignMemoryPage(STATICROOT + TOTAL_STATIC); |