Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16941 from webpack/feat/destructuring-assignment
Add support for destructuring assignment in parser. Enables tree-shaking for destructuring assignment in simple use cases.
- Loading branch information
Showing
14 changed files
with
272 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/cases/parsing/harmony-destructuring-assignment/counter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export let counter = 0; | ||
export const d = 1; | ||
export const c = 1; | ||
|
||
export const exportsInfo = { | ||
counter: __webpack_exports_info__.counter.used, | ||
d: __webpack_exports_info__.d.used, | ||
c: __webpack_exports_info__.c.used | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/cases/parsing/harmony-destructuring-assignment/counter2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export let counter = 0; | ||
export const d = 1; | ||
|
||
export const exportsInfo = { | ||
counter: __webpack_exports_info__.counter.used, | ||
d: __webpack_exports_info__.d.used | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/cases/parsing/harmony-destructuring-assignment/counter3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export let counter = 0; | ||
export const d = 1; | ||
|
||
export const exportsInfo = { | ||
counter: __webpack_exports_info__.counter.used, | ||
d: __webpack_exports_info__.d.used | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/cases/parsing/harmony-destructuring-assignment/counter4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export let counter = 0; | ||
export const d = 1; | ||
export const c = 1; | ||
export const e = 1; | ||
export const f = 1; | ||
export const g = 1; | ||
|
||
export const exportsInfo = { | ||
counter: __webpack_exports_info__.counter.used, | ||
d: __webpack_exports_info__.d.used, | ||
c: __webpack_exports_info__.c.used, | ||
e: __webpack_exports_info__.e.used, | ||
f: __webpack_exports_info__.f.used, | ||
g: __webpack_exports_info__.g.used | ||
}; |
Oops, something went wrong.