tc39 / tc39/test262

Annex B 3.3.3: Eval of block-scoped function declaration should skip with scopes

Open
#951 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.8k
Forks
564
Avg merge
3d 7h
Merged PRs (30d)
10

Description

We need to check that eval of block-scoped function declaration should skip with scope https://tc39.github.io/ecma262/#sec-web-compat-evaldeclarationinstantiation.
Cover this case:

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();

According to p.B.3.3.3.1.d.ii.4.b (If thisEnvRec is not an object Environment Record,
then) It should print:

eval
Reflect
p2
bar

Value baz should not be printed.

Original issue https://bugs.webkit.org/show_bug.cgi?id=163208#c46

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the inline JavaScript case and the linked ECMAScript section p.B.3.3.3.1.d.ii.4.b, then locate the existing Annex B eval tests in the repository. Add coverage for the with-scope behavior and verify that the output contains eval, Reflect, p2, and bar but not baz.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.