[Webkit-unassigned] [Bug 219275] New: block scope + const + hoisted function using the const = ReferenceError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 24 07:25:21 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=219275

            Bug ID: 219275
           Summary: block scope + const + hoisted function using the const
                    = ReferenceError
           Product: WebKit
           Version: Safari 14
          Hardware: All
                OS: iOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jakub.g.opensource at gmail.com

Open the following test page:
> https://jg-testpage.netlify.app/safari/const-inside-if.html

Its contents for reference:
```
  <script>
    if (true) {
      const MY_CONST = 'MY_CONST';
      function myFunction() {
        console.log(MY_CONST);
      }
      myFunction();
    }
  </script>
```

Expected:
> see "MY_CONST" logged

Actual:
> ReferenceError

Other browsers' behavior:
> "MY_CONST" is logged in latest Chrome, Firefox, EdgeLegacy 18

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201124/94501307/attachment-0001.htm>


More information about the webkit-unassigned mailing list