google / google/closure-compiler

"import *" seems to be broken

Open
#3,650 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

input:

```jsx
import * as THREE from 'three'

export default function(name) {
return THREE[name]
}
```

output (compilation_level: SIMPLE_OPTIMIZATIONS):

```jsx
import * as THREE from 'three'
export default function (a) {
return THREE[a]
}
```

👍

input:

```jsx
import * as THREE from 'three'

export default function(name) {
const o = new THREE.Group()
return THREE[name] + o.id
}
````

output:

```jsx
import { Group } from 'three'
export default function (a) {
let b = new Group()
return THREE[a] + b.id
}
```

😕 it took away the `THREE` import for some reason, `return THREE[a]` is now invalid.

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.