Open WillsterJohnsonAtZenesis opened 1 year ago
Adding @babel/plugin-transform-destructuring
in config argument babelCore.transform(src, config)
fixes the case: const { destruct1, destruct2, ...restDestruct } = arg0
. And @babel/plugin-transform-parameters
solves the function name({ destruct1, destruct2, ...restDestruct }) {/* ... */}
case. I am not sure that we need to add these plugins so it could increase somehow compilation time.
Seems that it may generally fail to collect any variable declarations from nested assignment destructuring.
For example, the following seems to fail only on the nested identifier prop
but has no problem with the first-level identifier name
.
const objects = [["name", { prop: 1 }]];
for (const [name, { prop }] of objects) {
console.log(prop);
}
Discovered the above example while manipulating some json with a similar shape. Using @ignore(prop)
silences the compiler warning.
Describe the bug
The following is valid ES6+ syntax;
For example;
However when using this paramater notation inside of a method on a Qooxdoo class, the compiler outputs a somewhat cryptic error.
Note that this occurs for all rest destructuring of objects, for example the following fails also;
To Reproduce
qx compile
Expected behavior
The compiler should compile the class, transpiling to older syntax if necessary.
Desktop (please complete the following information):
Additional Context
This does not occur if a destructured array paramater is used. The following class compiles without any issues;