Add more compat logic for Rest/SpreadElement for 6.x vs 7.x

This commit is contained in:
Logan Smyth
2017-05-11 18:04:25 -07:00
parent 899a754bef
commit 086cdfc705

View File

@@ -64,6 +64,14 @@ for (const type in t.VISITOR_KEYS) {
registerType(type);
}
// Compat helpers so code for Babel 6.x is more likely to work on Babel 7.x.
export function isRestProperty(...args) {
return t.isRestElement(...args);
}
export function isSpreadProperty(...args) {
return t.isSpreadElement(...args);
}
/**
* Flip `ALIAS_KEYS` for faster access in the reverse direction.
*/