Closed
Bug 23612
Opened 26 years ago
Closed 26 years ago
JavaScript mishandles characters \u001C - \u001F
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: waldemar, Assigned: rogerl)
Details
(Keywords: js1.5)
ECMAScript states that characters \u001C - \u001F in program source should be
treated as syntax errors. Our engine treats them as whitespace.
js> eval("2\u0018+4")
3: SyntaxError: illegal character:
3: 2+4
3: .^
This is correct.
js> eval("2\u001F+4")
6
This should also generate a syntax error.
Updated•26 years ago
|
Assignee: mccabe → rogerl
Comment 1•26 years ago
|
||
Forwarding to Roger.
| Reporter | ||
Comment 2•26 years ago
|
||
This bug is most easily fixed by changing entries 0x1C through 0x1F of js_Y[] in
jsstr.c from 1 to 0.
Comment 3•26 years ago
|
||
Do regexps classify those characters the same as the lexical grammar does? The
js_Y table (based on Java code) is used for both, IIRC.
/be
Comment 4•26 years ago
|
||
testcase ecma_3/Unicode/uc-001-n.js added
| Reporter | ||
Comment 5•26 years ago
|
||
According to ECMA, regexps should not treat these characters as white space
either. If regexps use the same table, then this fix would fix both problems.
We might want to add a test case for testing these characters against \s in a
regexp.
Comment 6•26 years ago
|
||
Added ecma_3/Unicode/uc-004.js testcase to cover regexp usage.
| Assignee | ||
Comment 7•26 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•