diff --git a/lib/sig.js b/lib/sig.js index d7454268..769834aa 100644 --- a/lib/sig.js +++ b/lib/sig.js @@ -61,8 +61,9 @@ exports.extractFunctions = body => { const functionStart = `${functionName}=function(a)`; const ndx = body.indexOf(functionStart); if (ndx >= 0) { - const subBody = body.slice(ndx + functionStart.length); - const functionBody = `var ${functionStart}${utils.cutAfterJSON(subBody)};${functionName}(ncode);`; + const end = body.indexOf('.join("")};', ndx); + const subBody = body.slice(ndx, end); + const functionBody = `${subBody}.join("")};${functionName}(ncode);`; functions.push(functionBody); } }