deprecate substr method and use existing strip function in grammar

This commit is contained in:
Qiang Li
2019-02-26 00:18:18 -08:00
parent 5cedd62d7b
commit 445ae12fa4
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export function SourceLocation(source, locInfo) {
export function id(token) {
if (/^\[.*\]$/.test(token)) {
return token.substr(1, token.length - 2);
return token.substring(1, token.length - 1);
} else {
return token;
}