`with` is deprecated, but there is still a bunch of legacy code that uses it. This code works fine in Firefox and Chrome but throws "Can't find variable: foo" in Safari: ```js let obj = {foo:"bar"}; with(obj) { function test() { console.log(foo); } } test(); ``` Perchance.org, for example, uses `with` as part of its DSL, and so a subset of 'generators' are broken for Safari users. Possibly related: https://bugs.webkit.org/show_bug.cgi?id=231166
<rdar://problem/111857202>
Thank you for reporting! This bug arises because block-level function declarations in global code, which are subject to currently unimplemented legacy Annex B hoisting, always receive top-level scope instead of lexical one. https://bugs.webkit.org/show_bug.cgi?id=163209 implements Annex B function hoisting for global code, fixing this issue. *** This bug has been marked as a duplicate of bug 163209 ***