forward-slash inside character-class is allowed #719

Closed
ericpromislow opened this Issue Oct 29, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

ericpromislow commented Oct 29, 2012

ecmascript-262 5th edition spec:

RegularExpressionClass ::
[ RegularExpressionClassChars ]

RegularExpressionClassChars ::
RegularExpressionClassChar*

RegularExpressionClassChar ::
RegularExpressionNonTerminator except (']', '')

RegularExpressionNonTerminator::
SourceCharacter except LineTerminator

SourceCharacter :: "any Unicode code unit"

LineTerminator:: LF | CR | LS | PS

ecmaScript-262 3rd edition is less clear, but also allows '/'
inside a character-class.

I personally would advise escaping such forward-slashes to improve clarity,
but I wouldn't emit the current "Unescaped '/'" message.

Please pass on to maintainers of jslint as well, same applies :)

Owner

valueof commented Oct 30, 2012

I don't know if we're going to remove this warning but wording it differently makes sense.

valueof closed this in 3148362 Oct 31, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment