aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jsifier.js4
-rw-r--r--src/parseTools.js6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index ca34d406..e9a051a4 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1392,7 +1392,9 @@ function JSify(data, functionsOnly, givenFunctions) {
}
var returnType;
- if (byPointer || ASM_JS) returnType = getReturnType(type);
+ 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 9bb7aec5..2e17c981 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -228,7 +228,11 @@ function isFunctionType(type, out) {
}
function getReturnType(type) {
- return type.substr(0, type.lastIndexOf('(')-1);
+ var lastOpen = type.lastIndexOf('(');
+ if (lastOpen > 0) {
+ return type.substr(0, lastOpen-1);
+ }
+ return type;
}
var isTypeCache = {}; // quite hot, optimize as much as possible