babel / babel/minify

Incorrect inlining within `with` statement

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

Description

``` js
var x = 0;
var myObj = {x : "obj"};
function f1(){
var x = 1;
function f2(){
with(myObj){
return x;
}
};
return f2();
}
```

minfies to:

``` js
var x = 0,
myObj = { x: "obj" };

function f1() {
;
return function () {
with (myObj) {
return 1;
}
}();
}
```

This should be `return "obj"` not `return 1`

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.