[Webkit-unassigned] [Bug 94681] New: Layout test fast/js/array-functions-non-arrays.html should not expect Array.prototype.toLocaleString.call({}) to throw

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 22 01:49:59 PDT 2012


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

           Summary: Layout test fast/js/array-functions-non-arrays.html
                    should not expect
                    Array.prototype.toLocaleString.call({}) to throw
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ulan at chromium.org
                CC: antonm at chromium.org


Layout test "fast/js/array-functions-non-arrays.html" has a test case that seems to be incorrect:

> shouldThrow("Array.prototype.toLocaleString.call({})");

The correct case would be 

> shouldBe("Array.prototype.toLocaleString.call({})", "");

ECMA 262/15.4.4.3 states that "The toLocaleString function is intentionally generic; it does not require that its this value be an Array object." 

Following the algorithm in the spec for {}, we get:

1. O = {}
2. arrayLen = O.length = undefined
3. len = ToUint32(arrayLen) = 0
4. set separator from locale
5. If len is zero, return the empty String.

At the moment JSC throws 'TypeError' when evaluating 'Array.prototype.toLocaleString.call({})'. Chrome and Firefox return empty string.

-- 
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