react-native-windows 0.74.45 → 0.74.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -278,7 +278,7 @@ JSValue const &JSValueObject::operator[](std::string_view propertyName) const no
|
|
|
278
278
|
return it->second;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
return JSValue::
|
|
281
|
+
return JSValue::NullRef();
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
bool JSValueObject::Equals(JSValueObject const &other) const noexcept {
|
|
@@ -434,6 +434,22 @@ void JSValueArray::WriteTo(IJSValueWriter const &writer) const noexcept {
|
|
|
434
434
|
/*static*/ JSValue const JSValue::EmptyArray{JSValueArray{}};
|
|
435
435
|
/*static*/ JSValue const JSValue::EmptyString{std::string{}};
|
|
436
436
|
|
|
437
|
+
const JSValue &JSValue::NullRef() noexcept {
|
|
438
|
+
return JSValue::Null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const JSValue &JSValue::EmptyObjectRef() noexcept {
|
|
442
|
+
return JSValue::EmptyObject;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const JSValue &JSValue::EmptyArrayRef() noexcept {
|
|
446
|
+
return JSValue::EmptyArray;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const JSValue &JSValue::EmptyStringRef() noexcept {
|
|
450
|
+
return JSValue::EmptyString;
|
|
451
|
+
}
|
|
452
|
+
|
|
437
453
|
#pragma warning(push)
|
|
438
454
|
#pragma warning(disable : 26495) // False positive for union member not initialized
|
|
439
455
|
JSValue::JSValue(JSValue &&other) noexcept : m_type{other.m_type} {
|
|
@@ -739,7 +755,7 @@ JSValue const *JSValue::TryGetObjectProperty(std::string_view propertyName) cons
|
|
|
739
755
|
|
|
740
756
|
JSValue const &JSValue::GetObjectProperty(std::string_view propertyName) const noexcept {
|
|
741
757
|
auto result = TryGetObjectProperty(propertyName);
|
|
742
|
-
return result ? *result :
|
|
758
|
+
return result ? *result : NullRef();
|
|
743
759
|
}
|
|
744
760
|
|
|
745
761
|
size_t JSValue::ItemCount() const noexcept {
|
|
@@ -752,7 +768,7 @@ JSValue const *JSValue::TryGetArrayItem(JSValueArray::size_type index) const noe
|
|
|
752
768
|
|
|
753
769
|
JSValue const &JSValue::GetArrayItem(JSValueArray::size_type index) const noexcept {
|
|
754
770
|
auto result = TryGetArrayItem(index);
|
|
755
|
-
return result ? *result :
|
|
771
|
+
return result ? *result : NullRef();
|
|
756
772
|
}
|
|
757
773
|
|
|
758
774
|
bool JSValue::Equals(JSValue const &other) const noexcept {
|
|
@@ -181,17 +181,25 @@ bool operator!=(JSValueArray const &left, JSValueArray const &right) noexcept;
|
|
|
181
181
|
//! For copy operations the explicit Copy() method must be used.
|
|
182
182
|
//! Note that the move operations are not thread safe.
|
|
183
183
|
struct JSValue {
|
|
184
|
-
//! JSValue with JSValueType::Null.
|
|
184
|
+
//! JSValue with JSValueType::Null. - Maybe removed in future version - replaced with NullRef
|
|
185
185
|
static JSValue const Null;
|
|
186
|
+
//! JSValue with JSValueType::Null.
|
|
187
|
+
static const JSValue &NullRef() noexcept;
|
|
186
188
|
|
|
187
|
-
//! JSValue with empty object.
|
|
189
|
+
//! JSValue with empty object. - Maybe removed in future version - replaced with EmptyObjectRef
|
|
188
190
|
static JSValue const EmptyObject;
|
|
191
|
+
//! JSValue with empty object.
|
|
192
|
+
static const JSValue &EmptyObjectRef() noexcept;
|
|
189
193
|
|
|
190
|
-
//! JSValue with empty array.
|
|
194
|
+
//! JSValue with empty array. - Maybe removed in future version - replaced with EmptyArrayRef
|
|
191
195
|
static JSValue const EmptyArray;
|
|
196
|
+
//! JSValue with empty array.
|
|
197
|
+
static const JSValue &EmptyArrayRef() noexcept;
|
|
192
198
|
|
|
193
|
-
//! JSValue with empty string.
|
|
199
|
+
//! JSValue with empty string. - Maybe removed in future version - replaced with EmptyStringRef
|
|
194
200
|
static JSValue const EmptyString;
|
|
201
|
+
//! JSValue with empty string.
|
|
202
|
+
static const JSValue &EmptyStringRef() noexcept;
|
|
195
203
|
|
|
196
204
|
//! Create a Null JSValue.
|
|
197
205
|
JSValue() noexcept;
|
|
@@ -654,11 +662,11 @@ inline double const *JSValue::TryGetDouble() const noexcept {
|
|
|
654
662
|
}
|
|
655
663
|
|
|
656
664
|
inline JSValueObject const &JSValue::AsObject() const noexcept {
|
|
657
|
-
return (m_type == JSValueType::Object) ? m_object :
|
|
665
|
+
return (m_type == JSValueType::Object) ? m_object : EmptyObjectRef().m_object;
|
|
658
666
|
}
|
|
659
667
|
|
|
660
668
|
inline JSValueArray const &JSValue::AsArray() const noexcept {
|
|
661
|
-
return (m_type == JSValueType::Array) ? m_array :
|
|
669
|
+
return (m_type == JSValueType::Array) ? m_array : EmptyArrayRef().m_array;
|
|
662
670
|
}
|
|
663
671
|
|
|
664
672
|
inline int8_t JSValue::AsInt8() const noexcept {
|
|
@@ -860,7 +868,7 @@ inline const JSValueArray &JSValue::Array() const noexcept {
|
|
|
860
868
|
}
|
|
861
869
|
|
|
862
870
|
inline const std::string &JSValue::String() const noexcept {
|
|
863
|
-
return (m_type == JSValueType::String) ? m_string :
|
|
871
|
+
return (m_type == JSValueType::String) ? m_string : EmptyStringRef().m_string;
|
|
864
872
|
}
|
|
865
873
|
|
|
866
874
|
inline bool JSValue::Boolean() const noexcept {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.74.
|
|
13
|
+
<ReactNativeWindowsVersion>0.74.46</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>46</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>146c018d53245bc3292b3ff1def8a0f3c065ccf8</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|