Bug 188920 - Switch statement without reached the case block
Summary: Switch statement without reached the case block
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-24 09:38 PDT by isol2
Modified: 2018-08-28 19:49 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description isol2 2018-08-24 09:38:35 PDT
Hi everyone,
there is an inconsistency in JSC if a switch statement with only one case block evaluation that could be not reached.

version: 235318
OS: Ubuntu 16.04 x64

steps to reproduce:
{ function f() { return "f 0"; } }
switch (1)
{
  case /0.0/gi:
    function f() {
       return "f 1";
    }
    break;
  default: 
    break;
}
print( f() );

Actual results:
f 1

Expected results:
f 0

V8 and SpiderMonkey works as expected.


cinfuzz