mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
PointerAlignment: Left
Summary: This changes Clang format config to enforce left pointer alignment instead of right, in accordance with https://www.internalfb.com/intern/wiki/Cpp/CppStyle/ Changelog: [Internal] bypass-github-export-checks Reviewed By: sammy-SC Differential Revision: D48952040 fbshipit-source-id: 108329b2f11d2041a31dee3334c7801d69a3f1ad
This commit is contained in:
committed by
Facebook GitHub Bot
parent
321f7dbcad
commit
d2e91599c8
@@ -15,86 +15,86 @@ NativeCxxModuleExample::NativeCxxModuleExample(
|
||||
: NativeCxxModuleExampleCxxSpec(std::move(jsInvoker)) {}
|
||||
|
||||
void NativeCxxModuleExample::getValueWithCallback(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
AsyncCallback<std::string> callback) {
|
||||
callback({"value from callback!"});
|
||||
}
|
||||
|
||||
std::vector<std::optional<ObjectStruct>> NativeCxxModuleExample::getArray(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::vector<std::optional<ObjectStruct>> arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
bool NativeCxxModuleExample::getBool(jsi::Runtime &rt, bool arg) {
|
||||
bool NativeCxxModuleExample::getBool(jsi::Runtime& rt, bool arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
ConstantsStruct NativeCxxModuleExample::getConstants(jsi::Runtime &rt) {
|
||||
ConstantsStruct NativeCxxModuleExample::getConstants(jsi::Runtime& rt) {
|
||||
return ConstantsStruct{true, 69, "react-native"};
|
||||
}
|
||||
|
||||
CustomEnumInt NativeCxxModuleExample::getCustomEnum(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
CustomEnumInt arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
std::shared_ptr<CustomHostObject> NativeCxxModuleExample::getCustomHostObject(
|
||||
jsi::Runtime &rt) {
|
||||
jsi::Runtime& rt) {
|
||||
return std::make_shared<CustomHostObject>(
|
||||
std::make_shared<CustomHostObjectRef>("answer", 42));
|
||||
}
|
||||
|
||||
std::string NativeCxxModuleExample::consumeCustomHostObject(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::shared_ptr<CustomHostObject> arg) {
|
||||
auto value = arg->getValue();
|
||||
return value->a_ + std::to_string(value->b_);
|
||||
}
|
||||
|
||||
NativeCxxModuleExampleCxxEnumFloat NativeCxxModuleExample::getNumEnum(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
NativeCxxModuleExampleCxxEnumInt arg) {
|
||||
return NativeCxxModuleExampleCxxEnumFloat::FB;
|
||||
}
|
||||
|
||||
NativeCxxModuleExampleCxxEnumStr NativeCxxModuleExample::getStrEnum(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
NativeCxxModuleExampleCxxEnumNone arg) {
|
||||
return NativeCxxModuleExampleCxxEnumStr::SB;
|
||||
}
|
||||
|
||||
std::map<std::string, std::optional<int32_t>> NativeCxxModuleExample::getMap(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::map<std::string, std::optional<int32_t>> arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
double NativeCxxModuleExample::getNumber(jsi::Runtime &rt, double arg) {
|
||||
double NativeCxxModuleExample::getNumber(jsi::Runtime& rt, double arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
ObjectStruct NativeCxxModuleExample::getObject(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
ObjectStruct arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
std::set<float> NativeCxxModuleExample::getSet(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::set<float> arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
std::string NativeCxxModuleExample::getString(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::string arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
std::string NativeCxxModuleExample::getUnion(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
float x,
|
||||
std::string y,
|
||||
jsi::Object z) {
|
||||
@@ -111,7 +111,7 @@ std::string NativeCxxModuleExample::getUnion(
|
||||
}
|
||||
|
||||
ValueStruct NativeCxxModuleExample::getValue(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
double x,
|
||||
std::string y,
|
||||
ObjectStruct z) {
|
||||
@@ -120,7 +120,7 @@ ValueStruct NativeCxxModuleExample::getValue(
|
||||
}
|
||||
|
||||
AsyncPromise<std::string> NativeCxxModuleExample::getValueWithPromise(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
bool error) {
|
||||
auto promise = AsyncPromise<std::string>(rt, jsInvoker_);
|
||||
if (error) {
|
||||
@@ -132,51 +132,51 @@ AsyncPromise<std::string> NativeCxxModuleExample::getValueWithPromise(
|
||||
}
|
||||
|
||||
std::optional<bool> NativeCxxModuleExample::getWithWithOptionalArgs(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
std::optional<bool> optionalArg) {
|
||||
return optionalArg;
|
||||
}
|
||||
|
||||
void NativeCxxModuleExample::voidFunc(jsi::Runtime &rt) {
|
||||
void NativeCxxModuleExample::voidFunc(jsi::Runtime& rt) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
void NativeCxxModuleExample::emitCustomDeviceEvent(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
jsi::String eventName) {
|
||||
// Test emitting device events (RCTDeviceEventEmitter.emit) from C++
|
||||
// TurboModule with arbitrary arguments
|
||||
emitDeviceEvent(
|
||||
rt,
|
||||
eventName.utf8(rt).c_str(),
|
||||
[](jsi::Runtime &rt, std::vector<jsi::Value> &args) {
|
||||
[](jsi::Runtime& rt, std::vector<jsi::Value>& args) {
|
||||
args.emplace_back(jsi::Value(true));
|
||||
args.emplace_back(jsi::Value(42));
|
||||
args.emplace_back(jsi::String::createFromAscii(rt, "stringArg"));
|
||||
});
|
||||
}
|
||||
|
||||
void NativeCxxModuleExample::voidFuncThrows(jsi::Runtime &rt) {
|
||||
void NativeCxxModuleExample::voidFuncThrows(jsi::Runtime& rt) {
|
||||
throw std::runtime_error("Intentional exception from Cxx voidFuncThrows");
|
||||
};
|
||||
|
||||
ObjectStruct NativeCxxModuleExample::getObjectThrows(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
ObjectStruct arg) {
|
||||
throw std::runtime_error("Intentional exception from Cxx getObjectThrows");
|
||||
};
|
||||
|
||||
AsyncPromise<jsi::Value> NativeCxxModuleExample::promiseThrows(
|
||||
jsi::Runtime &rt) {
|
||||
jsi::Runtime& rt) {
|
||||
throw std::runtime_error("Intentional exception from Cxx promiseThrows");
|
||||
};
|
||||
|
||||
void NativeCxxModuleExample::voidFuncAssert(jsi::Runtime &rt) {
|
||||
void NativeCxxModuleExample::voidFuncAssert(jsi::Runtime& rt) {
|
||||
react_native_assert(false && "Intentional assert from Cxx voidFuncAssert");
|
||||
};
|
||||
|
||||
ObjectStruct NativeCxxModuleExample::getObjectAssert(
|
||||
jsi::Runtime &rt,
|
||||
jsi::Runtime& rt,
|
||||
ObjectStruct arg) {
|
||||
react_native_assert(false && "Intentional assert from Cxx getObjectAssert");
|
||||
|
||||
@@ -185,7 +185,7 @@ ObjectStruct NativeCxxModuleExample::getObjectAssert(
|
||||
};
|
||||
|
||||
AsyncPromise<jsi::Value> NativeCxxModuleExample::promiseAssert(
|
||||
jsi::Runtime &rt) {
|
||||
jsi::Runtime& rt) {
|
||||
react_native_assert(false && "Intentional assert from Cxx promiseAssert");
|
||||
|
||||
// Asserts disabled
|
||||
|
||||
Reference in New Issue
Block a user