Update babylon beta 3 (#5394)

* Update babylon to v7-beta.3

* convert RestProperty/SpreadProperty to RestElement/SpreadElement

* add virtual types to make it easier to upgrade
This commit is contained in:
Henry Zhu
2017-02-28 16:58:19 -05:00
committed by GitHub
parent 6d6cdf6baf
commit 3ff77a61e4
17 changed files with 181 additions and 176 deletions

View File

@@ -140,7 +140,7 @@ export default function ({ types: t }) {
if (i >= spreadPropIndex) break;
// ignore other spread properties
if (t.isRestProperty(prop)) continue;
if (t.isRestElement(prop)) continue;
let key = prop.key;
if (t.isIdentifier(key) && !prop.computed) key = t.stringLiteral(prop.key.name);
@@ -192,7 +192,7 @@ export default function ({ types: t }) {
for (let i = 0; i < pattern.properties.length; i++) {
const prop = pattern.properties[i];
if (t.isRestProperty(prop)) {
if (t.isRestElement(prop)) {
this.pushObjectRest(pattern, objRef, prop, i);
} else {
this.pushObjectProperty(prop, objRef);