Skip to content

Commit

Permalink
Add test for labels shadow in mangle (close #185) (#224)
Browse files Browse the repository at this point in the history
* Add test for labels shadow in mangle (close #185)

* Upgrade dependencies
  • Loading branch information
boopathi authored and kangax committed Oct 27, 2016
1 parent ba7741d commit 6f9f606
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
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

0 comments on commit 6f9f606

Please sign in to comment.