<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>94688</bug_id>
          
          <creation_ts>2012-08-22 03:51:55 -0700</creation_ts>
          <short_desc>Layout test fast/js/toString-overrides.html should expect TypeError when toLocaleString is overwritten</short_desc>
          <delta_ts>2012-08-23 11:29:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>4147</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ulan Degenbaev">ulan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>oliver</cc>
    
    <cc>porten</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>701748</commentid>
    <comment_count>0</comment_count>
    <who name="Ulan Degenbaev">ulan</who>
    <bug_when>2012-08-22 03:51:55 -0700</bug_when>
    <thetext>Layout test fast/js/toString-overrides.html has the following test cases:

&gt; Number.prototype.toLocaleString = &quot;invalid&quot;;
&gt; shouldBe(&quot;[1].toLocaleString()&quot;, &quot;&apos;1&apos;&quot;);
&gt; RegExp.prototype.toLocaleString = &quot;invalid&quot;;
&gt; shouldBe(&quot;[/r/].toLocaleString()&quot;, &quot;&apos;toString2&apos;&quot;);

According to ECMA 262/15.4.4.3, both calls to &quot;toLocaleString()&quot; should throw TypeError because steps 8.a, 8.b of the spec algorithm state:

&gt; 8.a Let func be the result of calling the [[Get]] internal method of elementObj with argument &quot;toLocaleString&quot;.
&gt; 8.b If IsCallable(func) is false, throw a TypeError exception.

String &quot;invalid&quot; is not callable.

Both Chrome and Firefox throw TypeError in these cases:

&gt; FAIL [1].toLocaleString() should be 1. Threw exception TypeError: Property &apos;toLocaleString&apos; of object toString is not a function
&gt; FAIL [/r/].toLocaleString() should be toString2. Threw exception TypeError: Property &apos;toLocaleString&apos; of object toString2 is not a function</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>