Bug 183169

Summary: ReferenceError on constants within {}-block, unless in strict mode
Product: WebKit Reporter: Maarten Oosterwijk <maarten>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: maarten, ysuzuki
Priority: P2    
Version: Safari Technology Preview   
Hardware: All   
OS: macOS 10.13   

Maarten Oosterwijk
Reported 2018-02-27 12:16:44 PST
The following code/syntax throws a ReferenceError it should be valid es6 where MY_CONST is scoped to the {}-block { const MY_CONST = 60000; function doIt() { console.log(MY_CONST); }; doIt(); } in strict mode it works: "use strict"; { const MY_CONST = 60000; function doIt() { console.log(MY_CONST); }; doIt(); }
Attachments
Yusuke Suzuki
Comment 1 2018-03-01 21:52:42 PST
*** This bug has been marked as a duplicate of bug 163209 ***
Note You need to log in before you can comment on or make changes to this bug.