Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add --keep-names option to build command #41

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

HaydenOrz
Copy link
Contributor

To Resoved #38

What's changed

Enabling --keep-names option will change the bundle, as shown below:

  1. Two new lines of code have been added to the file header, which are used to keep the name of the class or function

    var __defProp = Object.defineProperty;
    var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
  2. A static methods will be added to all classes(in the case of ParseTreeWalker):

    var ParseTreeWalker = class _ParseTreeWalker {
      static {
        __name(this, "ParseTreeWalker");
      }
      // ...
     }

@mike-lischke mike-lischke merged commit 802f513 into mike-lischke:master Feb 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants