aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parseTools.js16
-rw-r--r--tests/runner.py1
2 files changed, 9 insertions, 8 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 3b4e8df4..322f87a9 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -738,14 +738,14 @@ function getLabelIds(labels) {
function getNativeTypeSize(type) {
if (QUANTUM_SIZE == 1) return 1;
var size = {
- '_i1': 1,
- '_i8': 1,
- '_i16': 2,
- '_i32': 4,
- '_i64': 8,
- "_float": 4,
- "_double": 8
- }['_'+type]; // add '_' since float&double confuse Closure compiler as keys.
+ '%i1': 1,
+ '%i8': 1,
+ '%i16': 2,
+ '%i32': 4,
+ '%i64': 8,
+ "%float": 4,
+ "%double": 8
+ }['%'+type]; // add '%' since float and double confuse Closure compiler as keys, and also spidermonkey as a compiler will remove 's from '_i8' etc
if (!size && type[type.length-1] == '*') {
size = QUANTUM_SIZE; // A pointer
}
diff --git a/tests/runner.py b/tests/runner.py
index db8d3637..31145a9f 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4201,6 +4201,7 @@ Child2:9
src = open(filename + '.cc.js', 'r').read()
assert re.search('function \w\(', src) # see before
assert 'function _main()' not in src # closure should have wiped it out
+ shutil.move(filename, filename + '.old.js')
open(filename, 'w').write(src)
self.do_run(src, '*closured*\ndata: 100,1,50,25\n', post_build=post)