[Webkit-unassigned] [Bug 55358] New: [Qt] JavaScript split function does not correspond to ECMAScript specification

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 28 01:56:11 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=55358

           Summary: [Qt] JavaScript split function does not correspond to
                    ECMAScript specification
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Windows 7
            Status: UNCONFIRMED
          Severity: Critical
          Priority: P3
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: deringer at vrvis.at


The split() function does not return an array containing an empty string when used on an empty string, instead an empty array is returned.

Paragraph 15.5.4.14 of ECMAScript says:
If the this object is (or converts to) the empty string, the result depends on whether separator can match the empty string. If it can, the result array contains no elements. Otherwise, the result array contains one element, which is the empty string.

This does not seem to be the case in QtWebKit 2.1 and 2.1.x. 

The JavaScript code

"".split(/\s+/).length;

returns 0 instead of 1. The returned array should contain the empty string.

The current nightly of WebKit r79754 does not have this bug.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list