Skip to content

Commit

Permalink
Avoid static_pointer_cast in GenerateModuleH.js (#44889)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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

Reviewed By: javache

Differential Revision: D58449748

fbshipit-source-id: 4d46b4e18fc28758296a67271182a471a99b5d83
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Jun 12, 2024
1 parent 20462ca commit c5d380f
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 c5d380f

Please sign in to comment.