Skip to content

Commit a08e2fb

Browse files
authored
fix: class factory included in sort (#6314)
## Summary Starting to sort polyfills after we transform a class into a class factory sometimes causes unwanted entries in the list of elements to sort. This fixes it.
1 parent fb69481 commit a08e2fb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-native-reanimated/plugin/build/plugin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-native-reanimated/plugin/src/class.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ function processClass(
6868

6969
const polyfilledClassAst = getPolyfilledAst(classPath.node, state);
7070

71+
sortPolyfills(polyfilledClassAst);
72+
7173
appendWorkletDirectiveToPolyfills(polyfilledClassAst.program.body);
7274

7375
replaceClassDeclarationWithFactoryAndCall(
7476
polyfilledClassAst.program.body,
7577
className
7678
);
7779

78-
sortPolyfills(polyfilledClassAst);
79-
8080
polyfilledClassAst.program.body.push(returnStatement(identifier(className)));
8181

8282
const factoryFactory = functionExpression(

0 commit comments

Comments
 (0)