WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
94681
Layout test fast/js/array-functions-non-arrays.html should not expect Array.prototype.toLocaleString.call({}) to throw
https://bugs.webkit.org/show_bug.cgi?id=94681
Summary
Layout test fast/js/array-functions-non-arrays.html should not expect Array.p...
Ulan Degenbaev
Reported
2012-08-22 01:49:57 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug