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

Add test for labels shadow in mangle (close #185) #224

Merged
merged 2 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
]
},
"devDependencies": {
"babel-core": "^6.14.0",
"babel-core": "^6.18.0",
"babel-jest": "^14.1.0",
"babel-plugin-transform-es2015-block-scoping": "^6.14.0",
"babel-preset-es2015": "^6.14.0",
"babel-traverse": "^6.14.0",
"babel-plugin-transform-es2015-block-scoping": "^6.18.0",
"babel-preset-es2015": "^6.18.0",
"babel-traverse": "^6.16.0",
"bytes": "^2.1.0",
"chalk": "^1.1.3",
"cli-table": "^0.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe("mangle-names", () => {
});

// https://phabricator.babeljs.io/T6957
xit("labels should not shadow bindings", () => {
it("labels should not shadow bindings", () => {
const source = unpad(`
function foo() {
var meh;
Expand All @@ -201,6 +201,28 @@ describe("mangle-names", () => {
expect(transform(source)).toBe(expected);
});

it("labels should not shadow bindings 2", () => {
const source = unpad(`
function f(a) {
try {
a: {
console.log(a);
}
} catch ($a) { }
}
`);
const expected = unpad(`
function f(b) {
try {
a: {
console.log(b);
}
} catch (c) {}
}
`);
expect(transform(source)).toBe(expected);
});

it("should be order independent", () => {
const source = unpad(`
function foo() {
Expand Down