`eval` variable resolution inside `with` scope performs `has` twice

RESOLVED DUPLICATE of bug 1166408

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 1166408
8 months ago
8 months ago

People

(Reporter: Saam Barati, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 months ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/604.1.5 (KHTML, like Gecko) Version/10.2 Safari/604.1.5

Steps to reproduce:

We're implementing some of the Annex B.3.3 scoping rules inside JavaScriptCore (you can follow along here, if interested, https://bugs.webkit.org/show_bug.cgi?id=163208), and found some weird behavior in SM that I wanted to report. I ran this using Firefox nightly.

It seems weird that SM is doing `has` twice for `eval` inside a `with` scope.

Here is the program:
```
function foo() {
    let p2 = new Proxy({}, {
        has(t, p) {
            console.log(p)
            return Reflect.has(t, p);
        }
    });
    with (p2) {
        eval("Reflect.has(p2, 'bar'); { function baz() { };  }");
    }
}
foo();
```

Here is the output:
```
eval
eval
Reflect
p2
bar
```

Updated

8 months ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1166408
You need to log in before you can comment on or make changes to this bug.