Last Comment Bug 23613 - JavaScript mishandles NBSP characters
: JavaScript mishandles NBSP characters
: js1.5
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All Mac System 8.6
P3 normal (vote)
: ---
Assigned To: rogerl (gone)
: Robert Ginda
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2000-01-10 21:32 PST by Waldemar Horwat
Modified: 2002-01-18 00:39 PST (History)
0 users
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Waldemar Horwat 2000-01-10 21:32:24 PST
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.
Comment 1 User image Mike McCabe 2000-01-10 22:15:59 PST
Forwarding to Roger.
Comment 2 User image Waldemar Horwat 2000-01-11 13:29:59 PST
This is most easily fixed by changing entry 0xA0 of js_Y[] in jsstr.c from 14 to
Comment 3 User image Brendan Eich [:brendan] 2000-01-18 15:56:59 PST
Same question as for bug 23612: will changes to js_Y break the dependent regexp

Comment 4 User image Robert Ginda 2000-01-18 16:52:59 PST
testcase ecma_3/Unicode/uc-002.js added
Comment 5 User image Waldemar Horwat 2000-01-18 17:27:59 PST
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 User image Robert Ginda 2000-01-18 17:37:59 PST
Added regexp test to testcase.
Comment 7 User image rogerl (gone) 2000-01-26 15:49:13 PST
Fix checked in.
Comment 8 User image Robert Ginda 2000-03-03 13:59:52 PST
Marking Verified.

Note You need to log in before you can comment on or make changes to this bug.