<?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>220142</bug_id>
          
          <creation_ts>2020-12-24 05:20:53 -0800</creation_ts>
          <short_desc>A possible issue about variable redeclaration</short_desc>
          <delta_ts>2020-12-31 12:28:26 -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>WebKit Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>163209</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yang Tian">nwu_ty</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>fpizlo</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1716570</commentid>
    <comment_count>0</comment_count>
    <who name="Yang Tian">nwu_ty</who>
    <bug_when>2020-12-24 05:20:53 -0800</bug_when>
    <thetext># Version
d940b47(https://github.com/WebKit/WebKit-http/commit/d940b477848884f63752d25491d9dd0b9d3ccb2d)

# Testcase1:
// Will throw an SyntaxError
function func() {
    if (1) {
        function o() {}
        var o = 1;
    }
}

# Testcase2:
// Will not throw an SyntaxError
if (1) {
    function o() {};
    var o = 1;
}

# Description
In both of the above examples, an variable &apos;o&apos; declaration error occurred, however Testcase1 throws an exception and Testcase2 doesn&apos;t.

I&apos;ve tried other engines(such as V8, SpiderMonkey), and they all throw SyntaxError, So i suspect it&apos;s a bug of jsc.

Please let me know the result whether this is a bug or not. Looking forward to your reply, thanks! 😆</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1716908</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-12-31 05:21:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/72754003&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1716926</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-12-31 12:28:26 -0800</bug_when>
    <thetext>Thanks, this is dupe of 163209 :)

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

    </bug>

</bugzilla>