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

Don't emit "duplicate label" error across function scopes. #1671

Merged
merged 1 commit into from
Oct 13, 2021

Commits on Oct 9, 2021

  1. Don't emit "duplicate label" error across function scopes.

    The code below is legal in JavaScript because labelled continue/break
    operators don't work across function boundaries:
    
    ```js
    l:
    while(true) {
      (function() {
        l:
        while (true) {
          break l;
        }
      })();
      break l;
    }
    ```
    
    Prior to this commit, esbuild would emit a "duplicate label" error for
    the inner label `l`. After this change search for possible duplicate
    will stop either when reaching the outermost scope (old behavior) or
    after reaching nearest function body scope (new behavior).
    nevkontakte committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    58b371a View commit details
    Browse the repository at this point in the history