Skip to content

Commit

Permalink
Avoid static_pointer_cast in GenerateModuleH.js (facebook#44889)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#44889

Avoid static_pointer_cast. It provides no type-safety, and requires increasing the shared_ptr

## Changelog:

[Internal] [Fixed] - Avoid static_pointer_cast in GenerateModuleH.js

Differential Revision: D58449748
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Jun 12, 2024
1 parent f12c930 commit 9e0477a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ function translateEventEmitterToCpp(
isArray ? `std::vector<${templateName}>` : templateName
}, ${jsiType}>, "value cannnot be converted to ${jsiType}");`
}
std::static_pointer_cast<AsyncEventEmitter<${
static_cast<AsyncEventEmitter<${
isVoidTypeAnnotation ? '' : 'jsi::Value'
}>>(delegate_.eventEmitterMap_["${eventEmitter.name}"])->emit(${
}>&>(*delegate_.eventEmitterMap_["${eventEmitter.name}"]).emit(${
isVoidTypeAnnotation
? ''
: `[jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
Expand Down

0 comments on commit 9e0477a

Please sign in to comment.