<?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>188790</bug_id>
          
          <creation_ts>2018-08-21 05:53:34 -0700</creation_ts>
          <short_desc>Wrong output when case clause is a conditional expression</short_desc>
          <delta_ts>2020-06-07 07:43:17 -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 Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <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>sunlili</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>1452052</commentid>
    <comment_count>0</comment_count>
    <who name="">sunlili</who>
    <bug_when>2018-08-21 05:53:34 -0700</bug_when>
    <thetext>Executing following code :
---------------------------------------------
(function()
{
    var f = 0;
    switch (f)
    {
        case ((f = 1)? 0 : 0):
            print(&quot;pass&quot;);
            break;
        default:
            print(f);
            print(&quot;fail&quot;);
            break;
    };
})();

print(&quot;BT_FLAG&quot;);
----------------------------------------------

Output should be :
pass
BT_FLAG

However, output of JavaScriptCore is :
1
fail
BT_FLAG



BT_GROUP
2018/8/21</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660069</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-06-07 07:42:25 -0700</bug_when>
    <thetext>(In reply to sunlili from comment #0)
&gt; Output should be :
&gt; pass
&gt; BT_FLAG

As of r262695, JSC is correct.
Test: https://trac.webkit.org/browser/webkit/trunk/JSTests/ChakraCore/test/Basics/switch.js?rev=262695#L55.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660070</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-06-07 07:43:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/64089530&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>