Skip to content

Improve scope system #72

@ben-sb

Description

@ben-sb

The current approach to gathering variable declarations and references is too loose and can result in incorrect deobfuscation. Since Shift doesn't provide this for us (like Babel does for example), a proper scope system should be implemented to collect all declarations and references.

Requirements:

  • Correctly handle all declarations and references
    • Including modern features such as object and array destructuring, import and export etc
  • Allow transformations to subscribe to the scope system, and request for the declarations and references to be updated
    • Could alternatively handle scopes once, then have each transformation register any changes it has made
      • Downside of this is writing transformations will become tedious

Can use a similar approach to Babel's scope system where we collect all declarations and references in one pass, then link them afterwards.
Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions