diff options
author | alon@honor <none@none> | 2010-10-15 23:15:05 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-15 23:15:05 -0700 |
commit | 0be63d3eeba00b0e68d309e4af84f4906b1750aa (patch) | |
tree | 80ea79592e02ecfaaa4365b382b40471c5251dc0 /src | |
parent | 5c33e208873515258c577350f2e006c1563b12af (diff) |
avoid redirection for math funcs
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rw-r--r-- | src/library.js | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 32b284ad..1f432afc 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -198,7 +198,9 @@ function JSify(data) { if (shortident in Library) { var snippet = Library[shortident]; if (typeof snippet === 'string') { - snippet = Library[snippet]; // redirection for aliases + if (Library[snippet]) { + snippet = Library[snippet]; // redirection for aliases + } } item.JS = item.ident + ' = ' + snippet.toString(); } else { diff --git a/src/library.js b/src/library.js index 0663d6c1..fc9e34c6 100644 --- a/src/library.js +++ b/src/library.js @@ -180,10 +180,10 @@ var Library = { // math.h - cos: function(x) { return Math.cos(x) }, - sin: function(x) { return Math.sin(x) }, - sqrt: function(x) { return Math.sqrt(x) }, - llvm_sqrt_f64: 'sqrt', + cos: 'Math.cos', + sin: 'Math.sin', + sqrt: 'Math.sqrt', + llvm_sqrt_f64: 'Math.sqrt', // unistd.h |