[Webkit-unassigned] [Bug 231166] New: "Can't find variable" that's let-declared within `with` statement when executing function that's declared within same `with` statement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 4 04:28:34 PDT 2021


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

            Bug ID: 231166
           Summary: "Can't find variable" that's let-declared within
                    `with` statement when executing function that's
                    declared within same `with` statement
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: yanahij531 at carpetd.com

In Firefox and Chrome the following code works fine, but Safari throws an error saying that the variable `a` cannot be found.

```
with({}) {
  let a = 1;
  function foo() {
    console.log(a);
  }
  foo();
}
```

https://jsbin.com/hiwihiyaxi/edit?html,console

-- 
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/20211004/5d754b4a/attachment.htm>


More information about the webkit-unassigned mailing list