Dmitry Panov 5 years ago
parent
commit
76b747147f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      parser/lexer.go

+ 3 - 0
parser/lexer.go

@@ -3,6 +3,7 @@ package parser
 import (
 	"errors"
 	"fmt"
+	"regexp"
 	"strconv"
 	"strings"
 	"unicode"
@@ -14,6 +15,8 @@ import (
 	"github.com/dop251/goja/unistring"
 )
 
+var matchIdentifier = regexp.MustCompile(`^[$_\p{L}][$_\p{L}\d}]*$`)
+
 func isDecimalDigit(chr rune) bool {
 	return '0' <= chr && chr <= '9'
 }