Skip to content

Commit

Permalink
update ccall regex to handle function names in the output #4111
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Feb 24, 2016
1 parent cddb79f commit 986dc30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/preamble.js
Expand Up @@ -192,7 +192,7 @@ var cwrap, ccall;
}

#if NO_DYNAMIC_EXECUTION == 0
var sourceRegex = /^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;
var sourceRegex = /^function\s*[a-zA-Z]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;
function parseJSFunc(jsfunc) {
// Match the body and the return value of a javascript function source
var parsed = jsfunc.toString().match(sourceRegex).slice(1);
Expand Down

0 comments on commit 986dc30

Please sign in to comment.