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

Crash minifying array destructuring (0.1.4) #617

Closed
AshleyScirra opened this issue Jul 4, 2017 · 0 comments
Closed

Crash minifying array destructuring (0.1.4) #617

AshleyScirra opened this issue Jul 4, 2017 · 0 comments
Labels
bug Confirmed bug

Comments

@AshleyScirra
Copy link

Minifying this:

function foo(arr)
{
	let [a, b] = arr;
};

Crashes with "SyntaxError: unknown: NodePath has been removed so is read-only. (This is an error on an internal node. Probably an internal error)"

A likely related case is this:

function foo()
{
	return getPromise()
	.then(arr =>
	{
		let [a, b] = arr;
		
		console.log(a);
	});
};

Minifying this succeeds, but the destructured let is completely removed, leaving references to nonexistent variables:

function foo() {
	return getPromise().then((b) => {
		console.log(a);  // oops: 'a' declaration removed
	});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants