diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-17 10:42:36 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-17 10:42:36 -0700 |
commit | ed40b36281285c39011240c16459d12c7acec9f7 (patch) | |
tree | 8e62d24cb96dcd1dff5349e5efa2dd8c34343a38 /src | |
parent | 396cb4f707dfab0a38edc40b430b441da353ffbb (diff) |
safe heap fix to catch undefined properly
Diffstat (limited to 'src')
-rw-r--r-- | src/preamble.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index e73089cb..986592ee 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -76,7 +76,7 @@ function SAFE_HEAP_STORE(dest, value, type, ignore) { Module.print('SAFE_HEAP store: ' + [dest, type, value, ignore]); #endif - if (!ignore && !value && value !== 0 && value !== false && !isNaN(value)) { // false can be the result of a mathop comparator; NaN can be the result of a math function + if (!ignore && !value && (value === null || value === undefined)) { throw('Warning: Writing an invalid value of ' + JSON.stringify(value) + ' at ' + dest + ' :: ' + new Error().stack + '\n'); } SAFE_HEAP_ACCESS(dest, type, true, ignore); |