<?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>33849</bug_id>
          
          <creation_ts>2010-01-19 10:58:09 -0800</creation_ts>
          <short_desc>const decl shadowing</short_desc>
          <delta_ts>2012-03-07 00:33:04 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>31813</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="anton muhin">antonm</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ager</cc>
    
    <cc>barraclough</cc>
    
    <cc>dglazkov</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>182322</commentid>
    <comment_count>0</comment_count>
      <attachid>46928</attachid>
    <who name="anton muhin">antonm</who>
    <bug_when>2010-01-19 10:58:09 -0800</bug_when>
    <thetext>Created attachment 46928
Small test to see how var and const declared properties are shadowed in various browsers

http://trac.webkit.org/changeset/47062 added a layout test to check that shadowing of const declared properties on global object is impossible.  However most of other browsers behave differently---attached HTML shows that FF, Opera and Safari allow to shadow both var and const declared properties (IE8 didn&apos;t output anything)---and only Safari forbids shadowing of const properties.

Semantics of shadowing/constness is not quite obvious, so it might be easily not a bug though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>182324</commentid>
    <comment_count>1</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2010-01-19 10:59:21 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; Created an attachment (id=46928) [details]
&gt; Small test to see how var and const declared properties are shadowed in various
&gt; browsers
&gt; 
&gt; http://trac.webkit.org/changeset/47062 added a layout test to check that
&gt; shadowing of const declared properties on global object is impossible.  However
&gt; most of other browsers behave differently---attached HTML shows that FF, Opera
&gt; and Safari allow to shadow both var and const declared properties (IE8 didn&apos;t
&gt; output anything)---and only Safari forbids shadowing of const properties.
&gt; 
&gt; Semantics of shadowing/constness is not quite obvious, so it might be easily
&gt; not a bug though.

Correction: FF, Opera and &lt;Chromium&gt; allow to shadow both var and const declared properties.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>572648</commentid>
    <comment_count>2</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2012-03-07 00:33:04 -0800</bug_when>
    <thetext>We should resolved this by implementing ES Harmony block scoped const.

*** This bug has been marked as a duplicate of bug 31813 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>46928</attachid>
            <date>2010-01-19 10:58:09 -0800</date>
            <delta_ts>2010-01-19 10:58:09 -0800</delta_ts>
            <desc>Small test to see how var and const declared properties are shadowed in various browsers</desc>
            <filename>test-const-var.html</filename>
            <type>text/html</type>
            <size>761</size>
            <attacher name="anton muhin">antonm</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8L2hlYWQ+Cjxib2R5IG9ubG9hZD0icnVuKCkiPgogIDxvbCBpZD0naWQx
Jz48L29sPgogIDxvbCBpZD0naWQyJz48L29sPgoKICA8aDE+Q2hlY2tpbmcgaG93IDx0dD5jb25z
dDwvdHQ+IGFuZCA8dHQ+dmFyPC90dD4gc2hhZG93aW5nIHdvcmtzPC9oMT4KICA8ZGl2IGlkPSJv
dXRwdXQiPjwvZGl2PgogIDxzY3JpcHQ+CiAgICBjb25zdCBpZDFfc2hhZG93ID0gImlkMSI7CiAg
ICBjb25zdCBpZDJfc2hhZG93ID0gImlkMiI7CgogICAgdmFyIGlkMSA9IGlkMV9zaGFkb3c7CiAg
ICBjb25zdCBpZDIgPSBpZDJfc2hhZG93OwoKICAgIGZ1bmN0aW9uIHN0YXR1cyhvYmosIHNoYWRv
d2VkLCBvcmlnaW5hbCkgewogICAgICBpZiAob2JqID09PSBzaGFkb3dlZCkgcmV0dXJuICJzaGFk
b3dlZCI7CiAgICAgIGlmIChvYmogPT09IG9yaWdpbmFsKSByZXR1cm4gIk5PVCBzaGFkb3dlZCI7
CiAgICAgIHJldHVybiAiV0VJUkQiOwogICAgfQoKICAgIGZ1bmN0aW9uIHJ1bigpIHsKICAgICAg
b3V0cHV0LmlubmVySFRNTCArPSAnPHA+dmFyIGlkMSAnICAgKyBzdGF0dXMoaWQxLCBpZDFfc2hh
ZG93LCBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWQxJykpICsgJzwvcD4nOwogICAgICBvdXRw
dXQuaW5uZXJIVE1MICs9ICc8cD5jb25zdCBpZDIgJyArIHN0YXR1cyhpZDIsIGlkMl9zaGFkb3cs
IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpZDInKSkgKyAnPC9wPic7CiAgICB9CiAgPC9zY3Jp
cHQ+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>