aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-07 11:10:52 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-07 11:10:52 -0800
commit2c2fda2daf63adada9f134c30b0044319b5e8237 (patch)
tree96630f46efeb2505b1604aa2206c7a4df627ef57 /src
parent6e7910e09d53d250dddcd5bfff4f1e72aa71be05 (diff)
notice Math.* library redirects as being functions
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 86568203..41ffe8c9 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -416,14 +416,15 @@ function JSify(data, functionsOnly, givenFunctions) {
var isFunction = false;
if (typeof snippet === 'string') {
- if (LibraryManager.library[snippet]) {
+ var target = LibraryManager.library[snippet];
+ if (target) {
// Redirection for aliases. We include the parent, and at runtime make ourselves equal to it.
// This avoid having duplicate functions with identical content.
redirectedIdent = snippet;
deps.push(snippet);
snippet = '_' + snippet;
}
- if (ASM_JS && typeof LibraryManager.library[redirectedIdent] == 'function') {
+ if (ASM_JS && (typeof target == 'function' || /Math\..+/.exec(snippet))) {
Functions.libraryFunctions[ident] = 1;
}
} else if (typeof snippet === 'object') {