Handle object rest parameters in the corejs3-usage plugin (#9724)

Fixes #9713
This commit is contained in:
Denis Pushkarev 2019-03-21 04:29:01 +07:00 committed by Nicolò Ribaudo
parent c259ec5408
commit 92fcd31eac
4 changed files with 23 additions and 4 deletions

View File

@ -189,10 +189,12 @@ export default function(
}
for (const property of path.get("properties")) {
const key = resolveKey(property.get("key"));
// const { keys, values } = Object
// const { keys, values } = [1, 2, 3]
this.addPropertyDependencies(source, key);
if (property.isObjectProperty()) {
const key = resolveKey(property.get("key"));
// const { keys, values } = Object
// const { keys, values } = [1, 2, 3]
this.addPropertyDependencies(source, key);
}
}
},

View File

@ -0,0 +1 @@
function test({ ...others }) {}

View File

@ -0,0 +1,12 @@
{
"presets": [
[
"../../../../lib",
{
"useBuiltIns": "usage",
"corejs": 3,
"targets": { "node": "8.10.0" }
}
]
]
}

View File

@ -0,0 +1,4 @@
"use strict";
function test({ ...others
}) {}