aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js2
-rw-r--r--src/parseTools.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 727fb41d..ca34d406 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1392,7 +1392,7 @@ function JSify(data, functionsOnly, givenFunctions) {
}
var returnType;
- if (byPointer || ASM_JS) returnType = type.split(' ')[0];
+ if (byPointer || ASM_JS) returnType = getReturnType(type);
if (byPointer) {
var sig = Functions.getSignature(returnType, argsTypes, hasVarArgs);
diff --git a/src/parseTools.js b/src/parseTools.js
index a5939994..9bb7aec5 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -227,6 +227,10 @@ function isFunctionType(type, out) {
return isFunctionDef({ text: argText, item: tokenize(argText.substr(1, argText.length-2), true) }, out);
}
+function getReturnType(type) {
+ return type.substr(0, type.lastIndexOf('(')-1);
+}
+
var isTypeCache = {}; // quite hot, optimize as much as possible
function isType(type) {
if (type in isTypeCache) return isTypeCache[type];