Skip to content

Commit

Permalink
fix: WorkletsError capturing
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Feb 3, 2025
1 parent 219ba8d commit c082c39
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ SPEC CHECKSUMS:
RNCMaskedView: 308c763227e237d4d260bd8841870e099572bb3e
RNFlashList: b799a0cdd1189c1f5064331548400dd79a7e3047
RNGestureHandler: 70069ab3e0431b03f6e465b65745f87a1a02c6c0
RNReanimated: 537897c4ac8d319041d74cd19b633a694fff3895
RNReanimated: 046c859afe6454f541abddad6fb755d8abc83351
RNScreens: 5d61e452b51e7c23b3fcb9f16c4967d683a60a9d
RNSVG: 2089e8b3a145acb2f392017279790f007f934567
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Expand Down
2 changes: 1 addition & 1 deletion apps/macos-example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ SPEC CHECKSUMS:
RNCAsyncStorage: c91d753ede6dc21862c4922cd13f98f7cfde578e
RNCClipboard: ee059e6006b137e369caed5eb852b4aad9f5d886
RNGestureHandler: 8c8722468ee6ced80a0723943c894798d2613a81
RNReanimated: 5e21c891ee78aa03ffbd0ce2c8d15a7c263f499f
RNReanimated: 618673a706b69b9c753f722bfff47ba943bb15b2
RNSVG: 46769c92d1609e617dbf9326ad8a0cff912d0982
SocketRocket: 9ee265c4b5ae2382d18e4ee1d2dd2d7af0ff1ab5
Yoga: 446e6f351a519539ff00a1159fe41e589aab1b94
Expand Down
2 changes: 1 addition & 1 deletion apps/tvos-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ SPEC CHECKSUMS:
ReactAppDependencyProvider: be4ae5b0ab2fcc7a26f9d1f3112b361649564fc7
ReactCodegen: d92b8ace8f895b98583e4c8e435598f3b36d6df4
ReactCommon: 6f652903c0e2db5459f031d2d2a65f3943cfb6c3
RNReanimated: 2c45b58e1d18e890221300ef979318217e5a0965
RNReanimated: 6b1cfb8a52b0bcae358f02492886b762d3648f95
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: ef409d2acea4e78ceb422d45fbed7f184c734a44

Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-reanimated/plugin/index.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions packages/react-native-reanimated/plugin/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ const notCapturedIdentifiers = [
'HermesInternal',

// Reanimated
'_WORKLET',
'ReanimatedError',
'__reanimatedLoggerConfig',

// Worklets
'_WORKLET',
'WorkletsError',
'__workletsLoggerConfig',
];

/**
Expand Down
5 changes: 4 additions & 1 deletion packages/react-native-worklets/src/worklets/WorkletsError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { createCustomError, registerCustomError } from './errors';

export const WorkletsError = createCustomError('Worklets');

// To capture it in a the registering worklet's closure.
const WorkletsErrorConstructor = WorkletsError;

export function registerWorkletsError() {
'worklet';
registerCustomError(WorkletsError, 'Worklets');
registerCustomError(WorkletsErrorConstructor, 'Worklets');
}

0 comments on commit c082c39

Please sign in to comment.