Closed Bug 23613 Opened 25 years ago Closed 25 years ago

JavaScript mishandles NBSP characters

Categories

(Core :: JavaScript Engine, defect, P3)

All
Mac System 8.6
defect

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.
Assignee: mccabe → rogerl
Forwarding to Roger.
Keywords: js1.5
This is most easily fixed by changing entry 0xA0 of js_Y[] in jsstr.c from 14 to 2.
Same question as for bug 23612: will changes to js_Y break the dependent regexp classification? /be
testcase ecma_3/Unicode/uc-002.js added
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.
Added regexp test to testcase.
Fix checked in.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Marking Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.