Skip to content

findFunctionName regex slightly off. #42

@iccir

Description

@iccir

First, thanks for the great project!

I found a slight issue in findFunctionName: the regex doesn't recognize the '$' character in function names, which is valid (along with underscore) per 7.6 Identifier Names and Identifiers of the ECMA-262 specification. Also, numbers are not allowed as the first character of identifiers.

On my local copy, I changed the following part of each regular expression:
/['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*

to:
/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions