<?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>153441</bug_id>
          
          <creation_ts>2016-01-25 13:18:54 -0800</creation_ts>
          <short_desc>Global lexical declarations should shadow configurable global properties</short_desc>
          <delta_ts>2016-06-23 11:30:12 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>148763</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="Elliott Sprehn">esprehn</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>adamk</cc>
    
    <cc>ggaren</cc>
    
    <cc>keith_miller</cc>
    
    <cc>rniwa</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1158468</commentid>
    <comment_count>0</comment_count>
    <who name="Elliott Sprehn">esprehn</who>
    <bug_when>2016-01-25 13:18:54 -0800</bug_when>
    <thetext>ex.

class Node { }

SyntaxError: Can&apos;t create duplicate variable that shadows a global property: &apos;Node&apos;

but you can write

var Node = class Node { }

this works fine in Chrome and Firefox 45.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204866</commentid>
    <comment_count>1</comment_count>
    <who name="Elliott Sprehn">esprehn</who>
    <bug_when>2016-06-23 11:13:10 -0700</bug_when>
    <thetext>This is still broken, I think something is wrong in your lexical scoping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204868</commentid>
    <comment_count>2</comment_count>
    <who name="Elliott Sprehn">esprehn</who>
    <bug_when>2016-06-23 11:14:58 -0700</bug_when>
    <thetext>I just checked today&apos;s nightly: r202375 and it still happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204871</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2016-06-23 11:22:11 -0700</bug_when>
    <thetext>In general, it seems that JSC refuses to create lexical bindings that shadow configurable properties on the global object, contra the spec (see https://tc39.github.io/ecma262/#sec-hasrestrictedglobalproperty). Here&apos;s a DOM-less repro:

&gt;&gt;&gt; let Array = 5
Exception: SyntaxError: Can&apos;t create duplicate variable that shadows a global property: &apos;Array&apos;

or one with a self-created property:

&gt;&gt;&gt; Object.defineProperty(this, &apos;foo&apos;, {value: 5, configurable: true, writable: true})
[object global]
&gt;&gt;&gt; let foo = 10
Exception: SyntaxError: Can&apos;t create duplicate variable that shadows a global property: &apos;Foo&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1204876</commentid>
    <comment_count>4</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-06-23 11:30:12 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 148763 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>