Skip to content

NewFunctionEnvironment AO missing call to NewDisposeCapability() #170

@rbuckton

Description

@rbuckton

In FunctionDefinitionInstantiation in non-strict mode we set the LexicalEnvironment of a function to a NewDeclarativeEnvironment() which correctly initializes [[DisposeCapability]] to a NewDisposeCapability(). However, in strict mode we reuse the LexicalEnvironment which happens to be a Function Environment Record that was created by NewFunctionEnvironment(), which does not correctly set its [[DisposeCapability]] slot.

We either need to unconditionally set [[DisposeCapability]] in NewFunctionEnvironment(), or conditionally set it in FunctionDefinitionInstantiation() when we opt to reuse the LexicalEnvironment. I feel the first option is probably cleaner, though.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions