Bug 25490 - ToNumber should ignore NBSP (\u00a0)
Summary: ToNumber should ignore NBSP (\u00a0)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL: http://hexmen.com/tests/pushpop.html
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-30 13:14 PDT by Ash Searle
Modified: 2010-07-12 14:33 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ash Searle 2009-04-30 13:14:04 PDT
This bug in ToNumber is the only reason WebKit fails a couple of array push/pop tests at the given URL. 

For a minimal test-case - do an unsigned right-shift as below.  Every case should result in 3, but we get an answer of 0 when there's a non-breaking space:
'\u0009 3' >>> 0; /* tab */
'\u0020 3' >>> 0; /* space */ 
'\u00a0 3' >>> 0; /* nbsp - fail! */

(see Section 9.3.1 of the EcmaScript 3rd edition spec for full list of white-space characters)
Comment 1 Darin Adler 2010-07-12 14:33:22 PDT
Committed r63120: <http://trac.webkit.org/changeset/63120>