diff --git a/js_test.go b/js_test.go index e7740857..9cbc0efe 100644 --- a/js_test.go +++ b/js_test.go @@ -156,10 +156,42 @@ func TestJSFunctionNameRegexp(t *testing.T) { input: "alert", expected: true, }, + { + input: "a", + expected: true, + }, + { + input: "$", + expected: true, + }, + { + input: "_", + expected: true, + }, + { + input: "$._", + expected: true, + }, { input: "console.log('hello')", expected: false, }, + { + input: "console.", + expected: false, + }, + { + input: ".log", + expected: false, + }, + { + input: "console..log", + expected: false, + }, + { + input: "1alert", + expected: false, + }, { input: "
Hello