Skip to content

Support optional chaining and nullish coalescing syntax #604

Closed

Description

@tedgoddard

Is your feature request related to a problem? Please describe.
Support optional chaining syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

For example a?.b

Describe the solution you'd like

Obfuscate code making use of optional chaining.

Describe alternatives you've considered

Disable obfuscation for files containing this syntax

Additional context
Add any other context or screenshots about the feature request here.

Activity

  1. sanex3339 commented on May 30, 2020

    @sanex3339
    Member

    Hi. We have to wait until this PR will be merged
    estools/escodegen#412

    But that PR depends on acorn PR with this feature. So, expect this not so soon.

  2. tedgoddard commented on Jun 5, 2020

    @tedgoddard
    Author

    Relevant Acorn PR: acornjs/acorn#891

  3. sanex3339 commented on Jun 11, 2020

    @sanex3339
    Member

    Acorn PR has been merged, now waiting for the escodegen PR.
    Also estraverse does not support this syntax out of the box, but there is fallback property to ignore it.

  4. sanex3339 commented on Jul 7, 2020

    @sanex3339
    Member

    This PR estools/escodegen#412 makes me sad

  5. sanex3339 commented on Jul 7, 2020

    @sanex3339
    Member

    I think that if I won't get any response during this week, I'll create the forks of escodegen (@javascript-obfuscator/escodegen package) and estraverse (@javascript-obfuscator/estraverse package) that will be used until these changes will be merged into the base repo

  6. changed the title [-]Support optional chaining syntax[/-] [+]Support optional chaining and nullish coalescing syntax[/+] on Jul 7, 2020
  7. sanex3339 commented on Jul 7, 2020

    @sanex3339
    Member

    Also here is the PR with nullish coalescing support
    estools/escodegen#417

  8. sanex3339 commented on Aug 6, 2020

    @sanex3339
    Member

    Optional chaining has been merged on escodegen side!

  9. sanex3339 commented on Aug 6, 2020

    @sanex3339
    Member

    Seems the last step is the PR for esrecurse because eslint-scope uses it.
    estools/esrecurse#22

  10. sanex3339 commented on Aug 6, 2020

    @sanex3339
    Member
  11. sanex3339 commented on Aug 6, 2020

    @sanex3339
    Member

    Optional chaining support has been merged. Expect the release with it later today.

  12. sanex3339 commented on Aug 6, 2020

    @sanex3339
    Member

    Optional chaining support still requires estools/esrecurse#22 but right now I avoided it by using Selective dependency resolutions feature of yarn

  13. sanex3339 commented on Aug 14, 2020

    @sanex3339
    Member

    Optional chaining support just has been released as 1.10.0

  14. sanex3339 commented on Nov 4, 2020

    @sanex3339
    Member

    Will be released soon as 2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions