RegExp: Internal CharacterRange() not throwing.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,811
Messages
2,569,693
Members
45,473
Latest member
Leanne70L5

Latest Threads

Top