perf: partially replace .concat with .push (#13609)
This commit is contained in:
@@ -136,9 +136,8 @@ export default function transformClass(
|
||||
|
||||
if (classState.userConstructor) {
|
||||
const { constructorBody, userConstructor, construct } = classState;
|
||||
constructorBody.body = constructorBody.body.concat(
|
||||
userConstructor.body.body,
|
||||
);
|
||||
|
||||
constructorBody.body.push(...userConstructor.body.body);
|
||||
t.inherits(construct, userConstructor);
|
||||
t.inherits(constructorBody, userConstructor.body);
|
||||
}
|
||||
@@ -695,7 +694,7 @@ export default function transformClass(
|
||||
|
||||
extractDynamicKeys();
|
||||
|
||||
let { body } = classState;
|
||||
const { body } = classState;
|
||||
const { closureParams, closureArgs } = setupClosureParamsArgs();
|
||||
|
||||
buildBody();
|
||||
@@ -712,8 +711,10 @@ export default function transformClass(
|
||||
);
|
||||
}
|
||||
|
||||
body = body.concat(
|
||||
classState.staticPropBody.map(fn => fn(t.cloneNode(classState.classRef))),
|
||||
body.push(
|
||||
...classState.staticPropBody.map(fn =>
|
||||
fn(t.cloneNode(classState.classRef)),
|
||||
),
|
||||
);
|
||||
|
||||
const isStrict = path.isInStrictMode();
|
||||
|
||||
Reference in New Issue
Block a user