Skip to content

Crash minifying array destructuring (0.1.4) #617

@AshleyScirra

Description

@AshleyScirra

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
	});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions