WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
94688
Layout test fast/js/toString-overrides.html should expect TypeError when toLocaleString is overwritten
https://bugs.webkit.org/show_bug.cgi?id=94688
Summary
Layout test fast/js/toString-overrides.html should expect TypeError when toLo...
Ulan Degenbaev
Reported
2012-08-22 03:51:55 PDT
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
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