[Webkit-unassigned] [Bug 94688] New: Layout test fast/js/toString-overrides.html should expect TypeError when toLocaleString is overwritten
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 22 03:51:57 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=94688
Summary: Layout test fast/js/toString-overrides.html should
expect TypeError when toLocaleString is overwritten
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: porten at kde.org
Depends on: 4147
Layout test fast/js/toString-overrides.html has the following test cases:
> Number.prototype.toLocaleString = "invalid";
> shouldBe("[1].toLocaleString()", "'1'");
> RegExp.prototype.toLocaleString = "invalid";
> shouldBe("[/r/].toLocaleString()", "'toString2'");
According to ECMA 262/15.4.4.3, both calls to "toLocaleString()" should throw TypeError because steps 8.a, 8.b of the spec algorithm state:
> 8.a Let func be the result of calling the [[Get]] internal method of elementObj with argument "toLocaleString".
> 8.b If IsCallable(func) is false, throw a TypeError exception.
String "invalid" is not callable.
Both Chrome and Firefox throw TypeError in these cases:
> FAIL [1].toLocaleString() should be 1. Threw exception TypeError: Property 'toLocaleString' of object toString is not a function
> FAIL [/r/].toLocaleString() should be toString2. Threw exception TypeError: Property 'toLocaleString' of object toString2 is not a function
--
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