Workaround #10179 in proposal-object-rest-spread (#10200)

This commit is contained in:
Nicolò Ribaudo 2019-07-15 19:01:29 +02:00 committed by GitHub
parent ee68d6d1b0
commit 7dc5fdb390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -455,6 +455,11 @@ export default declare((api, opts) => {
try {
helper = file.addHelper("objectSpread2");
} catch {
// TODO: This is needed to workaround https://github.com/babel/babel/issues/10187
// and https://github.com/babel/babel/issues/10179 for older @babel/core versions
// where #10187 isn't fixed.
this.file.declarations["objectSpread2"] = null;
// objectSpread2 has been introduced in v7.5.0
// We have to maintain backward compatibility.
helper = file.addHelper("objectSpread");