File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -408,10 +408,8 @@ export type WorkletFunction<
408408 *
409409 * ### Maintainer note
410410 *
411- * This function works well on the JS thread performance-wise, since the JIT can
412- * inline it. However, on other threads it will not get optimized and we will
413- * get a function call overhead. We want to change it in the future, but it's
414- * not feasible at the moment.
411+ * This function is supposed to be used only in the React Runtime. It always
412+ * returns `false` in Worklet Runtimes.
415413 */
416414export function isWorkletFunction <
417415 Args extends unknown [ ] = unknown [ ] ,
@@ -421,7 +419,9 @@ export function isWorkletFunction<
421419 'worklet' ;
422420 // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.
423421 // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.
422+
424423 return (
424+ // `__workletHash` isn't extracted in Worklet Runtimes.
425425 typeof value === 'function' &&
426426 ! ! ( value as unknown as Record < string , unknown > ) . __workletHash
427427 ) ;
You can’t perform that action at this time.
0 commit comments