Skip to content

Weird mangle error #554

@dhcmrlchtdj

Description

@dhcmrlchtdj

problem

Mangle is incorrect.

example

// input
function example() {
    let mangleError = [];
    let i = 10;
    while (--i) mangleError.push(i);
    return mangleError;
}

// output
"use strict";function example(){for(var a=[],b=10;--b;)a.push(b);return mangleError}
$ echo \
"function example() {
    let mangleError = [];
    let i = 10;
    while (--i) mangleError.push(i);
    return mangleError;
}" | ./node_modules/.bin/babel --presets=es2015,babili

package version

  • babel-preset-es2015@6.24.1
  • babel-preset-babili@0.1.2

update:
I found it's caused by --plugins=minify-simplify,transform-merge-sibling-variables,minify-mangle-names,transform-es2015-block-scoping

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugwith es2015The bug is caused when used with es2015-block-scoping plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions