aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/js-optimizer.js2
-rw-r--r--tools/shared.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 85171a02..f382496f 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2760,7 +2760,7 @@ function relocate(ast) {
} else if (node[2][1] == 'H_BASE') {
base = hBase;
}
- if (base) {
+ if (base !== null) {
var other = node[3];
if (other[0] == 'num') {
other[1] += base;
diff --git a/tools/shared.py b/tools/shared.py
index bc1177b2..1d70fcab 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1352,10 +1352,16 @@ chunkify = cache.chunkify
class JS:
memory_initializer_pattern = '/\* memory initializer \*/ allocate\(([\d,\.concat\(\)\[\]\\n ]+)"i8", ALLOC_NONE, Runtime\.GLOBAL_BASE\)'
+ no_memory_initializer_pattern = '/\* no memory initializer \*/'
@staticmethod
def to_nice_ident(ident): # limited version of the JS function toNiceIdent
- return ident.replace('%', '$').replace('@', '_');
+ return ident.replace('%', '$').replace('@', '_')
+
+ @staticmethod
+ def align(x, by):
+ while x % by != 0: x += 1
+ return x
# Compression of code and data for smaller downloads
class Compression: