/[\d-z]/.exec("-") should throw per ECMA. If that won't fix, as bug 351463 (which refers to bug 375876 that isn't readable for me) suggests, then there should be a comment in the code that explains the reason. Note that /[ -\d]/ does throw and that /[\d-]/ shouldn't throw. Opera has the same behavior as Mozilla.
Can you include the ECMA citation for this?
ECMA 262-3 22.214.171.124: | The internal helper function CharacterRange takes two CharSet parameters | A and B and performs the following: | | 1. If A does not contain exactly one character or B does not contain exactly | one character then throw a SyntaxError exception. [...] [\d\D\s\S\w\W] return CharSets containing more than one character (126.96.36.199).
Ah, right. Thanks for refreshing my memory. I've copied you to the original bug on this same issue, and am duping this bug to that one. Please feel free to contribute there.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 351463
You need to log in before you can comment on or make changes to this bug.