mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cbab004eb9
commit
0bacd9ceed
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user