aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-20 13:44:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-20 13:44:50 -0700
commit669c786e3554b280e31dcb7bd92931482547dae0 (patch)
tree110d48a9e6bf29ceed41ac6282dc37d2f0f3f433 /tools
parentb22f6fbbbebb5df55ceb8fdc9f7c4d111c902c5e (diff)
parent421e70ecf266d6619415b53c1bc03d4a127a585d (diff)
Merge branch 'incoming'
Diffstat (limited to 'tools')
-rwxr-xr-xtools/bindings_generator.py5
-rw-r--r--tools/js-optimizer.js11
-rw-r--r--tools/shared.py2
3 files changed, 10 insertions, 8 deletions
diff --git a/tools/bindings_generator.py b/tools/bindings_generator.py
index d2c165a2..d610ab54 100755
--- a/tools/bindings_generator.py
+++ b/tools/bindings_generator.py
@@ -62,6 +62,10 @@ Notes:
string on the *stack*. The C string will live for the current
function call. If you need it for longer, you need to create a copy
in your C++ code.
+
+ * You should compile with -s EXPORT_BINDINGS=1 in order for the
+ autogenerated bindings functions to be exported. This is necessary
+ when compiling in asm.js mode.
'''
import os, sys, glob, re
@@ -464,6 +468,7 @@ Module['getClass'] = getClass;
function customizeVTable(object, replacementPairs) {
// Does not handle multiple inheritance
+ // Does not work with asm.js
// Find out vtable size
var vTable = getValue(object.ptr, 'void*');
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 48ab5a1f..5ede0ce8 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2287,19 +2287,16 @@ function minifyGlobals(ast) {
function prepDotZero(ast) {
traverse(ast, function(node, type) {
if (type == 'unary-prefix' && node[1] == '+') {
- if (node[2][0] == 'num') {
+ if (node[2][0] == 'num' ||
+ (node[2][0] == 'unary-prefix' && node[2][1] == '-' && node[2][2][0] == 'num')) {
return ['call', ['name', 'DOT$ZERO'], [node[2]]];
- } else if (node[2][0] == 'unary-prefix' && node[2][1] == '-' && node[2][2][0] == 'num') {
- node[2][2][1] = -node[2][2][1];
- return ['call', ['name', 'DOT$ZERO'], [node[2][2]]];
}
}
});
}
function fixDotZero(js) {
- return js.replace(/DOT\$ZERO\(((0x)?[-+]?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)\)/g, function(m, num) {
- if (num.substr(0, 2) == '0x') {
- if (num[2] == '-') num = '-0x' + num.substr(3); // uglify generates 0x-8000 for some reason
+ return js.replace(/DOT\$ZERO\(([-+]?(0x)?[0-9a-f]*\.?[0-9]+([eE][-+]?[0-9]+)?)\)/g, function(m, num) {
+ if (num.substr(0, 2) == '0x' || num.substr(0, 3) == '-0x') {
return eval(num) + '.0';
}
if (num.indexOf('.') >= 0) return num;
diff --git a/tools/shared.py b/tools/shared.py
index 81a8e053..3d0f90b9 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -181,7 +181,7 @@ def check_node_version():
# we re-check sanity when the settings are changed)
# We also re-check sanity and clear the cache when the version changes
-EMSCRIPTEN_VERSION = '1.3.0'
+EMSCRIPTEN_VERSION = '1.3.1'
def check_sanity(force=False):
try: