Compare commits

...
Author SHA1 Message Date
Yedidya FeldblumandFacebook GitHub Bot 0bacd9ceed let Value be nothrow-move-constructible (#47422)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47422

Reviewed By: Gownta

Differential Revision: D65273055
2024-11-07 22:16:56 -08:00
2 changed files with 4 additions and 4 deletions
@@ -333,7 +333,7 @@ Function Object::asFunction(Runtime& runtime) && {
return std::move(*this).getFunction(runtime);
}
Value::Value(Value&& other) : Value(other.kind_) {
Value::Value(Value&& other) noexcept : Value(other.kind_) {
if (kind_ == BooleanKind) {
data_.boolean = other.data_.boolean;
} else if (kind_ == NumberKind) {
@@ -1121,7 +1121,7 @@ class JSI_EXPORT Function : public Object {
class JSI_EXPORT Value {
public:
/// Default ctor creates an \c undefined JS value.
Value() : Value(UndefinedKind) {}
Value() noexcept : Value(UndefinedKind) {}
/// Creates a \c null JS value.
/* implicit */ Value(std::nullptr_t) : kind_(NullKind) {}
@@ -1162,7 +1162,7 @@ class JSI_EXPORT Value {
"Value cannot be constructed directly from const char*");
}
Value(Value&& value);
Value(Value&& other) noexcept;
/// Copies a Symbol lvalue into a new JS value.
Value(Runtime& runtime, const Symbol& sym) : Value(SymbolKind) {
@@ -1217,7 +1217,7 @@ class JSI_EXPORT Value {
/// https://262.ecma-international.org/11.0/#sec-strict-equality-comparison
static bool strictEquals(Runtime& runtime, const Value& a, const Value& b);
Value& operator=(Value&& other) {
Value& operator=(Value&& other) noexcept {
this->~Value();
new (this) Value(std::move(other));
return *this;