N
Nisse Engström
Consider the following RegExp:
/[\d-0]/
ECMA-262 says:
<quote>
15.10.2.15 NonemptyClassRanges
...
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.
2. Let a be the one character in CharSet A.
3. Let b be the one character in CharSet B.
4. Let i be the code point value of character a.
5. Let j be the code point value of character b.
6. If I > j then throw a SyntaxError exception.
7. Return the set containing all characters numbered i through j,
inclusive.
</>
a) According to this, an exception should be thrown at
step 1, or failing that, at step 6. Is this correct?
The exceptions aren't thrown in Opera.
Test case:
<http://home.swipnet.se/sigsegv/opera/bugs/js-re-CharacterRange.html>
Result:
<http://home.swipnet.se/sigsegv/opera/bugs/js-re-CharacterRange.png>
b) Step 6 says "I > j". I can't find a definition of "I".
Is it a typo for "i", or is it an internal property or
some notational convention that I've missed?
--n
/[\d-0]/
ECMA-262 says:
<quote>
15.10.2.15 NonemptyClassRanges
...
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.
2. Let a be the one character in CharSet A.
3. Let b be the one character in CharSet B.
4. Let i be the code point value of character a.
5. Let j be the code point value of character b.
6. If I > j then throw a SyntaxError exception.
7. Return the set containing all characters numbered i through j,
inclusive.
</>
a) According to this, an exception should be thrown at
step 1, or failing that, at step 6. Is this correct?
The exceptions aren't thrown in Opera.
Test case:
<http://home.swipnet.se/sigsegv/opera/bugs/js-re-CharacterRange.html>
Result:
<http://home.swipnet.se/sigsegv/opera/bugs/js-re-CharacterRange.png>
b) Step 6 says "I > j". I can't find a definition of "I".
Is it a typo for "i", or is it an internal property or
some notational convention that I've missed?
--n