From: Ardis Lu Date: Sun, 11 Feb 2024 01:57:00 +0000 (-0800) Subject: Parse functions with space between identifier and parenthesis X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=bad26e3bb1d6d5769c4f0203cf84e2040bc978a2;p=4-byte-gen Parse functions with space between identifier and parenthesis --- diff --git a/index.html b/index.html index 16c61ca..667663f 100644 --- a/index.html +++ b/index.html @@ -454,11 +454,11 @@ // "... returns ()", then all keywords up until the last "returns" type is included in params. let functionRegex; if (strict) { - functionRegex = /^(function )(?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)(?!.+\))/; + functionRegex = /^(function )(?[a-zA-Z$_][a-zA-Z0-9$_]*) *\((?.*?)(?!.+\))/; } else { fn = fn.replaceAll(/[;'"]/g, ''); // Clean all characters that definitely do not affect the signature - functionRegex = /^(function )?(?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)(?!.+\))/; + functionRegex = /^(function )?(?[a-zA-Z$_][a-zA-Z0-9$_]*) *\((?.*?)(?!.+\))/; } const { name, parameters } = functionRegex.exec(fn).groups;