Skip to content

GetDirectiveContext broken? #36

Closed
Closed
@waldemarhorwat

Description

@waldemarhorwat

I'm having trouble reviewing what GetDirectiveContext is doing. It seems to make some unstated assumptions about what happens to be on the execution context stack at the time it is called. I can't tell whether that matches the lexical scope for all of the possible call paths and whether that will continue to be the case in the future.

Assuming that GetDirectiveContext does produce lexical scoping, its current implementation is broken because it only looks up one level. Consider the code:

function A() {
  "hide implementation";
  return function B() {
    ...
    return function C() {...}
  }
}

Function A's implementation will be hidden (via step 5 of FunctionInitialize), as will function B's (via GetDirectiveContext and step 7b of FunctionInitialize). However, function C's implementation will not be hidden. This seems strange.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions