Bug 188790
| Summary: | Wrong output when case clause is a conditional expression | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | sunlili |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ashvayka, fpizlo, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
sunlili
Executing following code :
---------------------------------------------
(function()
{
var f = 0;
switch (f)
{
case ((f = 1)? 0 : 0):
print("pass");
break;
default:
print(f);
print("fail");
break;
};
})();
print("BT_FLAG");
----------------------------------------------
Output should be :
pass
BT_FLAG
However, output of JavaScriptCore is :
1
fail
BT_FLAG
BT_GROUP
2018/8/21
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
(In reply to sunlili from comment #0)
> Output should be :
> pass
> 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.
Radar WebKit Bug Importer
<rdar://problem/64089530>