Bug 187094

Summary: Inconsistent output compared with other JS engines when declare a function in try...catch
Product: WebKit Reporter: sunlili
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ysuzuki
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   

Description sunlili 2018-06-27 06:39:32 PDT
Hello,
The following code behaves strangely (inconsistent with other engines).

try {                                                                                                                                                                
    f0();
    function g(f0){
        f0();
    };  

}catch(g){}
g(()=>{print("hi");});

In Safari, output is
hi

However, in V8 and Firefox, output is
TypeError: g is not a function

BT group
2018.6.27
Comment 1 Yusuke Suzuki 2020-12-31 12:38:41 PST
Thanks, this is dupe of 163209 :)

*** This bug has been marked as a duplicate of bug 163209 ***