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

Cannot access 'n' before initialization #508

Closed
bp0002 opened this issue Nov 11, 2019 · 2 comments
Closed

Cannot access 'n' before initialization #508

bp0002 opened this issue Nov 11, 2019 · 2 comments
Labels

Comments

@bp0002
Copy link

bp0002 commented Nov 11, 2019

Bug report or Feature request?
Bug report

Version (4.3.1)

Complete CLI command or minify() options used

// options
{
  toplevel: true,
  compress: {
    passes: 5,
    pure_getters: true
  },
}

terser input

const foo = () => {
    let a;

    {
        let b = [];

        {
            console.log();
        }


        a = b;

        {
            let c = a;
            let b = 123456;
            console.log(b);
            c.push(b);
        }


    }
};

foo();

terser output or error

(()=>{let o;console.log();{let l=o=n,n=123456;console.log(n),l.push(n)}})()
// err
Uncaught ReferenceError: Cannot access 'n' before initialization

Expected result

@fabiosantoscode
Copy link
Collaborator

Excellent report, thanks!

@fabiosantoscode
Copy link
Collaborator

This has been fixed and is out now as 4.4.1. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants