Bug 113901 - charAt() javascript function misbehaving in WebKit browsers
Summary: charAt() javascript function misbehaving in WebKit browsers
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 15:02 PDT by javascriptjedi
Modified: 2013-04-07 09:15 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description javascriptjedi 2013-04-03 15:02:39 PDT
The following bug happens in Safari 5.1.7 (7534.57.2) for Windows XP, Google Chrome 27.0.1425.0 (185065) for OpenSUSE 12.2, and Google Chrome 26.0.1410.43 m for Windows XP, so I believe it's a WebKit issue.

The bug is:

"  ".charAt(1) == " "  

evaluates to false.  (The first string is two spaces.)

On all other browsers--Firefox, and IE, it evaluates to true as one would expect.
Comment 1 Alexey Proskuryakov 2013-04-04 09:43:41 PDT
I cannot reproduce this with Safari 6.0.3 on Mac. This likely got fixed in WebKit since Safari 5.1.7 release.

> Google Chrome 27.0.1425.0 (185065) for OpenSUSE 12.2, and Google Chrome 26.0.1410.43 m for Windows XP, so I believe it's a WebKit issue.

Chrome uses a different JavaScript engine, so its issues are separate.
Comment 2 javascriptjedi 2013-04-07 00:48:01 PDT
I would find it extremely unlikely that this very strange bug occurred twice in independent code streams (It doesn't occur in either FF or IE).  Therefore, almost certainly Safari 5 and Google Chrome ARE based on the same JavaScript engine, or at least, whatever part is exercised by the charAt() function.

Google Chrome in fact recommends that bugs occurring in multiple WebKit browsers be filed against WebKit, so they agree.  However, since you closed this, looks like I'll have to file against them alone.

You marked this as closed, yet there is no Safari 6 for Windows, so that is not a solution for me.  I don't appreciate you unilaterally deciding this issue isn't important.
Comment 3 javascriptjedi 2013-04-07 02:00:45 PDT
I did some more digging and see that this issue seems to happen ONLY in the watch tab of Chrome and Safari 5.  That is, if you type

"  ".charAt(1) == " " 

in the console of either browser, it returns true as expected, but if you type it in the "watch" window, of Chrome or Safari 5 (tested Mac Snow Leopard and windows), it returns false.

I can't find the "add watch" window in Safari 6, since things have been shuffled around - I can only find the console, where I expect you tried this.

However, given that it worked in Safari 5 console, you must test in the "add watch" window of Safari 6 to make sure.

As to why this is important, would you want to fight this bug in your watch window while debugging something else?  I don't think so.
Comment 4 Alexey Proskuryakov 2013-04-07 09:15:18 PDT
No one says that this is not important. However, the WebKit project is responsible for the development of the WebKit engine, and we have no impact on products that are released based on it.

Chrome having parted ways with WebKit <http://blog.chromium.org/2013/04/blink-rendering-engine-for-chromium.html>, there is no known way to reproduce this issue in WebKit based browsers, so we cannot track this issue here. It's just not actionable.

Please feel free to re-open if you find a way to reproduce this in a current version of any WebKit based product, such as Safari 6.0.3.