Closed
Bug 23613
Opened 26 years ago
Closed 26 years ago
JavaScript mishandles NBSP characters
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: waldemar, Assigned: rogerl)
Details
(Keywords: js1.5)
ECMAScript requires that \u00A0 (the non-breaking space character) be treated
like other white space in program source. Our engine generates a syntax error:
js> eval("2\u00A0+3")
15: SyntaxError: illegal character:
15: 2Ý+3
15: .^
This should print 5.
Updated•26 years ago
|
Assignee: mccabe → rogerl
Comment 1•26 years ago
|
||
Forwarding to Roger.
Reporter | ||
Comment 2•26 years ago
|
||
This is most easily fixed by changing entry 0xA0 of js_Y[] in jsstr.c from 14 to
2.
Comment 3•26 years ago
|
||
Same question as for bug 23612: will changes to js_Y break the dependent regexp
classification?
/be
Comment 4•26 years ago
|
||
testcase ecma_3/Unicode/uc-002.js added
Reporter | ||
Comment 5•26 years ago
|
||
Same answer as for bug 23612: A \s in a regexp should recognize \u00A0 inside a
target string as white space. Fixing the table would fix regexps as well. We
might want to add a test case.
Comment 6•26 years ago
|
||
Added regexp test to testcase.
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
•