Fixed reusing node in destructuring plugin, which caused caching issue in helper-module-transforms (#6374)
This commit is contained in:
parent
91cde0148d
commit
68182bd69f
@ -211,7 +211,7 @@ export default function({ types: t }) {
|
||||
if (t.isRestElement(prop)) {
|
||||
this.pushObjectRest(pattern, objRef, prop, i);
|
||||
} else {
|
||||
this.pushObjectProperty(prop, objRef);
|
||||
this.pushObjectProperty(prop, t.clone(objRef));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
import { NestedObjects } from "./some-module"
|
||||
|
||||
const { Foo, Bar } = NestedObjects
|
||||
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var _someModule = require("./some-module");
|
||||
|
||||
const Foo = _someModule.NestedObjects.Foo,
|
||||
Bar = _someModule.NestedObjects.Bar;
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-es2015-destructuring", "transform-es2015-modules-commonjs"]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user