Avoid static_pointer_cast in GenerateModuleH.js (#44889)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Родитель
20462ca984
Коммит
c5d380fc98
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче