The default bug view has changed. See this FAQ.

JavaScript mishandles NBSP characters

VERIFIED FIXED

Status

()

Core
JavaScript Engine
P3
normal
VERIFIED FIXED
17 years ago
15 years ago

People

(Reporter: Waldemar Horwat, Assigned: rogerl (gone))

Tracking

({js1.5})

Trunk
All
Mac System 8.6
js1.5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
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

17 years ago
Assignee: mccabe → rogerl

Comment 1

17 years ago
Forwarding to Roger.

Updated

17 years ago
Keywords: js1.5
(Reporter)

Comment 2

17 years ago
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

Comment 4

17 years ago
testcase ecma_3/Unicode/uc-002.js added
(Reporter)

Comment 5

17 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

17 years ago
Added regexp test to testcase.
(Assignee)

Comment 7

17 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 8

17 years ago
Marking Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.