Closed Bug 1689078 Opened 5 years ago Closed 5 years ago

Clearly separate regular standalone function and event listener

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(3 files)

Currently "standalone function" in frontend means 2 things:

  • Function (or generator/async) constructor call
  • event handler with possible non-empty non-syntactic scope

treating both of them as "standalone function" sounds confusing,
we should add some new name for event handler case, to clarify what the target function is,
and separate the code for each case.

Compilation except delazification shouldn't access enclosing scope with
environment coordinate.

For eval, we shouldn't search in enclosing scope but just fallback to
either global or dynamic name access.

For other cases, the enclosing scope should be either empty global or null.

To make it clearer that a function with enclosing scope is special, and
different thing than standalone functions (new Function() etc), added dedicate
function/method for it.

Also refactored CreateNonSyntacticEnvironmentChain not to create scope, given
other consumers doesn't need it.

Depends on D103290

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/760701eca8bd Part 1: Assert the target of searchInEnclosingScope for non-delazification. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/b2990c289595 Part 2: Add frontend::CompileStandaloneFunctionInNonSyntacticScope. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/8dac478e6727 Part 3: Use fallbackFreeNameLocation_ for standalone function. r=mgaudet
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: