babel / babel/minify

Mangle redeclares/reuses the same variable name that's in outer scope

Open
#896 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

My code was compiled to:

Outermost scope:

```js
(function() {
var e = Math.ceil
, n = String.fromCharCode
, r = Math.min
, l = Math.pow
, o = Math.PI
, h = Number.isInteger
...
```

Middle scope:

```js
var o, r, l, d, y, m, h, ...
...
h = void 0 === (ve = n.fillMode) ? "both" : ve,
...
```

Inner scope:

```js
...
0 <= ["forwards", "both"].indexOf(h) ? (()=>(r = h(y) && !n
...
```

When running in browser, it threw the error:

```
Uncaught TypeError: h is not a function
```

(Since this is a private repo I couldn't disclose more of my code)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.