diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-09 13:33:05 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-09 13:33:05 -0800 |
commit | 06c7bd01799e072514f6043491f1c20cac80ef4a (patch) | |
tree | f7bf8fe90cfa8b47d4bf654e7f729c7c0055b578 /src | |
parent | 6cf86dad35cc55413e0cfacd52a88f07b62d5eee (diff) |
fixes for isNiceIdent
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 24c38296..743b9793 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -95,9 +95,9 @@ function toNiceIdentCarefully(ident) { // is true, then also allow () and spaces. function isNiceIdent(ident, loose) { if (loose) { - return /^[\w$_ ()]+$/.test(ident); + return /^\(?[\w$_]+[\w$_\d ]*\)?$/.test(ident); } else { - return /^[\w$_]+$/.test(ident); + return /^[\w$_]+[\w$_\d]*$/.test(ident); } } |