-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: @putout/plugin-merge-destructuring-properties: exclude remov…
…e parentPath
- Loading branch information
1 parent
8ce44a8
commit cae5511
Showing
9 changed files
with
114 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
packages/plugin-merge-destructuring-properties/test/fixture/minify-fix.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,22 @@ | ||
const {defineProperty: a} = Object; | ||
let c = null; | ||
var d = 1073741823, {keys: b} = Object; | ||
|
||
function A(...e) { | ||
if (n) | ||
return new Proxy({ | ||
get(n) {}, | ||
has(n) { | ||
return !1; | ||
}, | ||
keys() { | ||
n.push(...b(resolveSource(e[t]))); | ||
}, | ||
}, propTraps); | ||
|
||
const t = {}, r = Object.create(null); | ||
|
||
for (let n = e.length - 1; n >= 0; n--) | ||
const s = Object.getOwnPropertyNames(o), i = Object.getOwnPropertyDescriptor(o, n) | ||
a(o, n, t); | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/plugin-merge-destructuring-properties/test/fixture/minify.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,21 @@ | ||
let scheduledCallback = null;const maxSigned31BitInt = 1073741823; | ||
|
||
function mergeProps(...e) { | ||
if (n) | ||
return new Proxy({get(n) { | ||
}, has(n) { | ||
return!1; | ||
}, keys() { | ||
n.push(...Object.keys(resolveSource(e[t]))); | ||
}}, propTraps); | ||
|
||
const t = {}, r = Object.create(null); | ||
|
||
for (let n = e.length - 1;n >= 0;n--) { | ||
const s = Object.getOwnPropertyNames(o); | ||
const i = Object.getOwnPropertyDescriptor(o, n); | ||
} | ||
|
||
Object.defineProperty(o, n, t); | ||
} | ||
|
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
22 changes: 22 additions & 0 deletions
22
packages/plugin-minify/test/fixture/merge-destructuring-properties-fix.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,22 @@ | ||
const {defineProperty: a} = Object; | ||
let c = null; | ||
var d = 1073741823, {keys: b} = Object; | ||
|
||
function A(...e) { | ||
if (n) | ||
return new Proxy({ | ||
get(n) {}, | ||
has(n) { | ||
return !1; | ||
}, | ||
keys() { | ||
n.push(...b(resolveSource(e[t]))); | ||
}, | ||
}, propTraps); | ||
|
||
const t = {}, r = Object.create(null); | ||
|
||
for (let n = e.length - 1; n >= 0; n--) | ||
const s = Object.getOwnPropertyNames(o), i = Object.getOwnPropertyDescriptor(o, n) | ||
a(o, n, t); | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/plugin-minify/test/fixture/merge-destructuring-properties.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,21 @@ | ||
let scheduledCallback = null;const maxSigned31BitInt = 1073741823; | ||
|
||
function mergeProps(...e) { | ||
if (n) | ||
return new Proxy({get(n) { | ||
}, has(n) { | ||
return!1; | ||
}, keys() { | ||
n.push(...Object.keys(resolveSource(e[t]))); | ||
}}, propTraps); | ||
|
||
const t = {}, r = Object.create(null); | ||
|
||
for (let n = e.length - 1;n >= 0;n--) { | ||
const s = Object.getOwnPropertyNames(o); | ||
const i = Object.getOwnPropertyDescriptor(o, n); | ||
} | ||
|
||
Object.defineProperty(o, n, t); | ||
} | ||
|
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