react-native-windows 0.82.3 → 0.83.0-preview.1
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.
- package/.flowconfig +2 -7
- package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
- package/Libraries/Animated/components/AnimatedImage.js +4 -3
- package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
- package/Libraries/Animated/components/AnimatedText.js +7 -3
- package/Libraries/Animated/components/AnimatedView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +24 -12
- package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +43 -15
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
- package/Libraries/Components/Glyph/Glyph.js +4 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
- package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.windows.js +1 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
- package/Libraries/Components/Switch/Switch.d.ts +2 -2
- package/Libraries/Components/Switch/Switch.windows.js +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
- package/Libraries/Components/TextInput/TextInput.js +6 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +6 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +7 -7
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
- package/Libraries/Components/View/View.d.ts +2 -2
- package/Libraries/Components/View/View.windows.js +0 -1
- package/Libraries/Components/View/ViewNativeComponent.js +13 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpPerformance.js +2 -0
- package/Libraries/Debugging/DebuggingOverlay.js +14 -14
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
- package/Libraries/Image/Image.d.ts +3 -3
- package/Libraries/Image/ImageInjection.js +3 -6
- package/Libraries/Image/ImageTypes.flow.js +3 -7
- package/Libraries/Lists/FlatList.js +8 -8
- package/Libraries/Lists/SectionList.d.ts +5 -1
- package/Libraries/Lists/ViewabilityHelper.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
- package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
- package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
- package/Libraries/Network/RCTNetworking.android.js +3 -1
- package/Libraries/Network/RCTNetworking.ios.js +3 -0
- package/Libraries/Network/RCTNetworking.windows.js +3 -0
- package/Libraries/Network/XMLHttpRequest.js +1 -41
- package/Libraries/Pressability/usePressability.js +14 -3
- package/Libraries/ReactNative/PaperUIManager.windows.js +3 -3
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
- package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
- package/Libraries/Renderer/shims/ReactNative.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +2 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
- package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
- package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
- package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
- package/Libraries/Text/Text.d.ts +2 -2
- package/Libraries/Text/TextNativeComponent.js +10 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
- package/Libraries/Utilities/DevLoadingView.js +14 -6
- package/Libraries/Utilities/HMRClient.js +13 -5
- package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
- package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -40
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +3 -80
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +45 -12
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +20 -36
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
- package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
- package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
- package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
- package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/Warnings.props +2 -1
- package/ReactCommon/ReactCommon.vcxproj +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +5 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +6 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +15 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +4 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +5 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +36 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +2 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +19 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +16 -1
- package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
- package/Scripts/creaternwapp.cmd +1 -1
- package/Scripts/perf/compare-results.js +357 -0
- package/Scripts/perf/create-perf-test.js +343 -0
- package/Scripts/perf/post-pr-comment.js +210 -0
- package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
- package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
- package/Shared/Shared.vcxitems +15 -3
- package/Shared/Shared.vcxitems.filters +11 -3
- package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
- package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +6 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
- package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
- package/codegen/react/components/rnwcore/Props.cpp +6 -1
- package/codegen/react/components/rnwcore/Props.h +1 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
- package/codegen/react/components/rnwcore/Switch.g.h +11 -6
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
- package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
- package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
- package/codegen/rnwcoreJSI.h +3973 -6059
- package/index.js +6 -0
- package/index.windows.js +6 -0
- package/jest/mockComponent.js +6 -6
- package/jest/setup.js +15 -10
- package/package.json +27 -27
- package/src/private/components/virtualview/VirtualView.js +22 -27
- package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/performance/ResourceTiming.js +31 -4
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
- package/stubs/double-conversion/double-conversion.h +5 -0
- package/templates/cpp-app/template.config.js +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/template.config.js +1 -1
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/index.d.ts +1 -0
- package/types/public/ReactNativeTypes.d.ts +115 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
- package/Scripts/OpenSSL.nuspec +0 -39
- package/Scripts/OpenSSL.targets +0 -36
- package/codegen/rnwcoreJSI-generated.cpp +0 -3470
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
11
12
|
#endif
|
|
12
13
|
#include "Instance.h"
|
|
13
14
|
|
|
14
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
15
16
|
|
|
16
17
|
#include "ErrorUtils.h"
|
|
17
18
|
#include "JSBigString.h"
|
|
@@ -373,7 +374,8 @@ void Instance::JSCallInvoker::scheduleAsync(CallFunc&& work) noexcept {
|
|
|
373
374
|
|
|
374
375
|
} // namespace facebook::react
|
|
375
376
|
|
|
376
|
-
#endif //
|
|
377
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
378
|
+
|
|
377
379
|
#if _MSC_VER
|
|
378
380
|
#pragma warning(pop)
|
|
379
381
|
#endif
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
@@ -22,11 +23,11 @@ namespace facebook::react {
|
|
|
22
23
|
std::string JSExecutor::getSyntheticBundlePath(
|
|
23
24
|
uint32_t bundleId,
|
|
24
25
|
const std::string& bundlePath) {
|
|
25
|
-
#ifndef
|
|
26
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
26
27
|
if (bundleId == RAMBundleRegistry::MAIN_BUNDLE_ID) {
|
|
27
28
|
return bundlePath;
|
|
28
29
|
}
|
|
29
|
-
#endif //
|
|
30
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
30
31
|
|
|
31
32
|
std::array<char, 32> buffer{};
|
|
32
33
|
std::snprintf(buffer.data(), buffer.size(), "seg-%u.js", bundleId);
|
|
@@ -42,6 +43,7 @@ JSExecutor::getRuntimeTargetDelegate() {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
} // namespace facebook::react
|
|
46
|
+
|
|
45
47
|
#if _MSC_VER
|
|
46
48
|
#pragma warning(pop)
|
|
47
49
|
#endif
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
11
12
|
#endif
|
|
12
13
|
#include "JSIndexedRAMBundle.h"
|
|
13
14
|
|
|
14
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
15
16
|
|
|
16
17
|
#include <glog/logging.h>
|
|
17
18
|
#include <fstream>
|
|
@@ -137,7 +138,8 @@ void JSIndexedRAMBundle::readBundle(
|
|
|
137
138
|
|
|
138
139
|
} // namespace facebook::react
|
|
139
140
|
|
|
140
|
-
#endif //
|
|
141
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
142
|
+
|
|
141
143
|
#if _MSC_VER
|
|
142
144
|
#pragma warning(pop)
|
|
143
145
|
#endif
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
11
12
|
#endif
|
|
12
13
|
#include "MethodCall.h"
|
|
13
14
|
|
|
14
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
15
16
|
|
|
16
17
|
#include <folly/json.h>
|
|
17
18
|
#include <stdexcept>
|
|
@@ -92,7 +93,8 @@ std::vector<MethodCall> parseMethodCalls(folly::dynamic&& jsonData) {
|
|
|
92
93
|
|
|
93
94
|
} // namespace facebook::react
|
|
94
95
|
|
|
95
|
-
#endif //
|
|
96
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
97
|
+
|
|
96
98
|
#if _MSC_VER
|
|
97
99
|
#pragma warning(pop)
|
|
98
100
|
#endif
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
11
12
|
#endif
|
|
12
13
|
#include "ModuleRegistry.h"
|
|
13
14
|
|
|
14
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
15
16
|
|
|
16
17
|
#include <glog/logging.h>
|
|
17
18
|
#include <reactperflogger/BridgeNativeModulePerfLogger.h>
|
|
@@ -194,7 +195,7 @@ std::optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name) {
|
|
|
194
195
|
// no constants or methods
|
|
195
196
|
return std::nullopt;
|
|
196
197
|
} else {
|
|
197
|
-
return ModuleConfig{index, std::move(config)};
|
|
198
|
+
return ModuleConfig{.index = index, .config = std::move(config)};
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
|
|
@@ -248,7 +249,8 @@ MethodCallResult ModuleRegistry::callSerializableNativeHook(
|
|
|
248
249
|
|
|
249
250
|
} // namespace facebook::react
|
|
250
251
|
|
|
251
|
-
#endif //
|
|
252
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
253
|
+
|
|
252
254
|
#if _MSC_VER
|
|
253
255
|
#pragma warning(pop)
|
|
254
256
|
#endif
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include "NativeToJsBridge.h"
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
16
16
|
|
|
17
17
|
#include <ReactCommon/CallInvoker.h>
|
|
18
18
|
#include <folly/json.h>
|
|
@@ -43,8 +43,8 @@ namespace facebook::react {
|
|
|
43
43
|
|
|
44
44
|
// This class manages calls from JS to native code.
|
|
45
45
|
class [[deprecated(
|
|
46
|
-
"This API will be removed along with the legacy architecture.")]]
|
|
47
|
-
|
|
46
|
+
"This API will be removed along with the legacy architecture.")]]
|
|
47
|
+
JsToNativeBridge : public react::ExecutorDelegate {
|
|
48
48
|
public:
|
|
49
49
|
JsToNativeBridge(
|
|
50
50
|
std::shared_ptr<ModuleRegistry> registry,
|
|
@@ -356,7 +356,7 @@ NativeToJsBridge::getInspectorTargetDelegate() {
|
|
|
356
356
|
|
|
357
357
|
} // namespace facebook::react
|
|
358
358
|
|
|
359
|
-
#endif //
|
|
359
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
360
360
|
|
|
361
361
|
#if _MSC_VER
|
|
362
362
|
#pragma warning(pop)
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
11
12
|
#endif
|
|
12
13
|
#include "RAMBundleRegistry.h"
|
|
13
14
|
|
|
14
|
-
#ifndef
|
|
15
|
+
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
15
16
|
|
|
16
17
|
#include <folly/String.h>
|
|
17
18
|
|
|
@@ -74,8 +75,8 @@ JSModulesUnbundle::Module RAMBundleRegistry::getModule(
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
return {
|
|
77
|
-
"seg-" + std::to_string(bundleId) + '_' + module.name,
|
|
78
|
-
std::move(module.code),
|
|
78
|
+
.name = "seg-" + std::to_string(bundleId) + '_' + module.name,
|
|
79
|
+
.code = std::move(module.code),
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -85,7 +86,8 @@ JSModulesUnbundle* RAMBundleRegistry::getBundle(uint32_t bundleId) const {
|
|
|
85
86
|
|
|
86
87
|
} // namespace facebook::react
|
|
87
88
|
|
|
88
|
-
#endif //
|
|
89
|
+
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
90
|
+
|
|
89
91
|
#if _MSC_VER
|
|
90
92
|
#pragma warning(pop)
|
|
91
93
|
#endif
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
#if _MSC_VER
|
|
9
10
|
#pragma warning(push)
|
|
10
11
|
#pragma warning(disable : 4996) // deprecated APIs
|
|
@@ -142,6 +143,7 @@ double StartupLogger::getAppStartupEndTime() {
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
} // namespace facebook::react::ReactMarker
|
|
146
|
+
|
|
145
147
|
#if _MSC_VER
|
|
146
148
|
#pragma warning(pop)
|
|
147
149
|
#endif
|
|
@@ -69,13 +69,13 @@ namespace facebook::react {
|
|
|
69
69
|
struct TraceSection {
|
|
70
70
|
public:
|
|
71
71
|
template <typename... ConvertsToStringPiece>
|
|
72
|
-
explicit TraceSection(
|
|
73
|
-
|
|
74
|
-
[[maybe_unused]] ConvertsToStringPiece&&... args) {
|
|
72
|
+
explicit TraceSection([[maybe_unused]] const char *name, [[maybe_unused]] ConvertsToStringPiece &&...args)
|
|
73
|
+
{
|
|
75
74
|
TRACE_EVENT_BEGIN("react-native", perfetto::DynamicString{name}, args...);
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
~TraceSection()
|
|
77
|
+
~TraceSection()
|
|
78
|
+
{
|
|
79
79
|
TRACE_EVENT_END("react-native");
|
|
80
80
|
}
|
|
81
81
|
};
|
|
@@ -84,10 +84,10 @@ using TraceSectionUnwrapped = TraceSection;
|
|
|
84
84
|
struct ConcreteTraceSection {
|
|
85
85
|
public:
|
|
86
86
|
template <typename... ConvertsToStringPiece>
|
|
87
|
-
explicit ConcreteTraceSection(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
explicit ConcreteTraceSection(const char *name, ConvertsToStringPiece &&...args)
|
|
88
|
+
: m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) // [Windows][issue #14819]
|
|
89
|
+
{
|
|
90
|
+
}
|
|
91
91
|
|
|
92
92
|
private:
|
|
93
93
|
fbsystrace::FbSystraceSection m_section;
|
|
@@ -97,9 +97,9 @@ using TraceSectionUnwrapped = ConcreteTraceSection;
|
|
|
97
97
|
struct DummyTraceSection {
|
|
98
98
|
public:
|
|
99
99
|
template <typename... ConvertsToStringPiece>
|
|
100
|
-
explicit DummyTraceSection(
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
explicit DummyTraceSection([[maybe_unused]] const char *name, [[maybe_unused]] ConvertsToStringPiece &&...args)
|
|
101
|
+
{
|
|
102
|
+
}
|
|
103
103
|
};
|
|
104
104
|
using TraceSectionUnwrapped = DummyTraceSection;
|
|
105
105
|
#endif
|
|
@@ -110,14 +110,14 @@ using TraceSectionUnwrapped = DummyTraceSection;
|
|
|
110
110
|
* In the case of WITH_LOOM_TRACE we don't use the signposts APIs because of the
|
|
111
111
|
* templated type for TraceSection.
|
|
112
112
|
*/
|
|
113
|
-
#if defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES &&
|
|
114
|
-
!defined(WITH_LOOM_TRACE)
|
|
113
|
+
#if defined(__APPLE__) && OS_LOG_TARGET_HAS_10_15_FEATURES && !defined(WITH_LOOM_TRACE)
|
|
115
114
|
|
|
116
115
|
namespace systrace {
|
|
117
116
|
|
|
118
117
|
template <typename T, typename = void>
|
|
119
118
|
struct renderer {
|
|
120
|
-
static std::string render(const T&
|
|
119
|
+
static std::string render(const T &t)
|
|
120
|
+
{
|
|
121
121
|
std::ostringstream oss;
|
|
122
122
|
oss << t;
|
|
123
123
|
return oss.str();
|
|
@@ -125,19 +125,19 @@ struct renderer {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
template <typename T>
|
|
128
|
-
static auto render(const T&
|
|
129
|
-
|
|
128
|
+
static auto render(const T &t) -> decltype(renderer<T>::render(std::declval<const T &>()))
|
|
129
|
+
{
|
|
130
130
|
return renderer<T>::render(t);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
inline os_log_t instrumentsLogHandle = nullptr;
|
|
134
134
|
|
|
135
|
-
static inline os_log_t getOrCreateInstrumentsLogHandle()
|
|
135
|
+
static inline os_log_t getOrCreateInstrumentsLogHandle()
|
|
136
|
+
{
|
|
136
137
|
static std::once_flag flag{};
|
|
137
138
|
std::call_once(flag, []() {
|
|
138
139
|
if (!instrumentsLogHandle) {
|
|
139
|
-
instrumentsLogHandle = os_log_create(
|
|
140
|
-
"dev.reactnative.instruments", OS_LOG_CATEGORY_DYNAMIC_TRACING);
|
|
140
|
+
instrumentsLogHandle = os_log_create("dev.reactnative.instruments", OS_LOG_CATEGORY_DYNAMIC_TRACING);
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
return instrumentsLogHandle;
|
|
@@ -148,8 +148,8 @@ static inline os_log_t getOrCreateInstrumentsLogHandle() {
|
|
|
148
148
|
struct TraceSection {
|
|
149
149
|
public:
|
|
150
150
|
template <typename... ConvertsToStringPiece>
|
|
151
|
-
explicit TraceSection(const char*
|
|
152
|
-
|
|
151
|
+
explicit TraceSection(const char *name, ConvertsToStringPiece &&...args) : systraceSectionUnwrapped_(name, args...)
|
|
152
|
+
{
|
|
153
153
|
os_log_t instrumentsLogHandle = systrace::getOrCreateInstrumentsLogHandle();
|
|
154
154
|
|
|
155
155
|
// If the log isn't enabled, we don't want the performance overhead of the
|
|
@@ -168,24 +168,14 @@ struct TraceSection {
|
|
|
168
168
|
|
|
169
169
|
signpostID_ = os_signpost_id_make_with_pointer(instrumentsLogHandle, this);
|
|
170
170
|
|
|
171
|
-
os_signpost_interval_begin(
|
|
172
|
-
instrumentsLogHandle,
|
|
173
|
-
signpostID_,
|
|
174
|
-
"Systrace",
|
|
175
|
-
"%s begin: %s",
|
|
176
|
-
name,
|
|
177
|
-
argsString.c_str());
|
|
171
|
+
os_signpost_interval_begin(instrumentsLogHandle, signpostID_, "Systrace", "%s begin: %s", name, argsString.c_str());
|
|
178
172
|
}
|
|
179
173
|
|
|
180
|
-
~TraceSection()
|
|
174
|
+
~TraceSection()
|
|
175
|
+
{
|
|
181
176
|
// We don't need to gate on os_signpost_enabled here because it's already
|
|
182
177
|
// checked in os_signpost_interval_end.
|
|
183
|
-
os_signpost_interval_end(
|
|
184
|
-
systrace::instrumentsLogHandle,
|
|
185
|
-
signpostID_,
|
|
186
|
-
"Systrace",
|
|
187
|
-
"%s end",
|
|
188
|
-
name_.data());
|
|
178
|
+
os_signpost_interval_end(systrace::instrumentsLogHandle, signpostID_, "Systrace", "%s end", name_.data());
|
|
189
179
|
}
|
|
190
180
|
|
|
191
181
|
private:
|
|
@@ -44,19 +44,23 @@ TEST_P(JSITest, PropNameIDTest) {
|
|
|
44
44
|
EXPECT_TRUE(PropNameID::compare(rt, movedQuux, copiedQuux));
|
|
45
45
|
|
|
46
46
|
EXPECT_TRUE(PropNameID::compare(rt, movedQuux, movedQuux));
|
|
47
|
-
EXPECT_TRUE(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
EXPECT_TRUE(
|
|
48
|
+
PropNameID::compare(
|
|
49
|
+
rt, movedQuux, PropNameID::forAscii(rt, std::string("quux2"))));
|
|
50
|
+
EXPECT_FALSE(
|
|
51
|
+
PropNameID::compare(
|
|
52
|
+
rt, movedQuux, PropNameID::forAscii(rt, std::string("foo"))));
|
|
51
53
|
uint8_t utf8[] = {0xF0, 0x9F, 0x86, 0x97};
|
|
52
54
|
PropNameID utf8PropNameID = PropNameID::forUtf8(rt, utf8, sizeof(utf8));
|
|
53
55
|
EXPECT_EQ(
|
|
54
56
|
utf8PropNameID.utf8(rt), reinterpret_cast<const char*>(u8"\U0001F197"));
|
|
55
|
-
EXPECT_TRUE(
|
|
56
|
-
|
|
57
|
+
EXPECT_TRUE(
|
|
58
|
+
PropNameID::compare(
|
|
59
|
+
rt, utf8PropNameID, PropNameID::forUtf8(rt, utf8, sizeof(utf8))));
|
|
57
60
|
PropNameID nonUtf8PropNameID = PropNameID::forUtf8(rt, "meow");
|
|
58
|
-
EXPECT_TRUE(
|
|
59
|
-
|
|
61
|
+
EXPECT_TRUE(
|
|
62
|
+
PropNameID::compare(
|
|
63
|
+
rt, nonUtf8PropNameID, PropNameID::forAscii(rt, "meow")));
|
|
60
64
|
EXPECT_EQ(nonUtf8PropNameID.utf8(rt), "meow");
|
|
61
65
|
PropNameID strPropNameID =
|
|
62
66
|
PropNameID::forString(rt, String::createFromAscii(rt, "meow"));
|
|
@@ -149,11 +153,12 @@ TEST_P(JSITest, ObjectTest) {
|
|
|
149
153
|
obj.setProperty(rt, "oprop", oprop);
|
|
150
154
|
obj.setProperty(rt, "aprop", Array(rt, 1));
|
|
151
155
|
|
|
152
|
-
EXPECT_TRUE(function(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
EXPECT_TRUE(function(
|
|
157
|
+
"function (obj) { return "
|
|
158
|
+
"obj.roses == 'red' && "
|
|
159
|
+
"obj['violets'] == 'blue' && "
|
|
160
|
+
"typeof obj.oprop == 'object' && "
|
|
161
|
+
"Array.isArray(obj.aprop); }")
|
|
157
162
|
.call(rt, obj)
|
|
158
163
|
.getBool());
|
|
159
164
|
|
|
@@ -247,7 +252,7 @@ TEST_P(JSITest, HostObjectTest) {
|
|
|
247
252
|
EXPECT_TRUE(cho.getHostObject<ConstantHostObject>(rt).get() != nullptr);
|
|
248
253
|
|
|
249
254
|
struct SameRuntimeHostObject : HostObject {
|
|
250
|
-
SameRuntimeHostObject(Runtime& rt) : rt_(rt){};
|
|
255
|
+
SameRuntimeHostObject(Runtime& rt) : rt_(rt) {};
|
|
251
256
|
|
|
252
257
|
Value get(Runtime& rt, const PropNameID& sym) override {
|
|
253
258
|
EXPECT_EQ(&rt, &rt_);
|
|
@@ -731,14 +736,15 @@ TEST_P(JSITest, HostFunctionTest) {
|
|
|
731
736
|
EXPECT_TRUE(eval("cons.length == 2").getBool());
|
|
732
737
|
EXPECT_TRUE(eval("cons instanceof Function").getBool());
|
|
733
738
|
|
|
734
|
-
EXPECT_TRUE(eval(
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
739
|
+
EXPECT_TRUE(eval(
|
|
740
|
+
"(function() {"
|
|
741
|
+
" try {"
|
|
742
|
+
" cons('fail'); return false;"
|
|
743
|
+
" } catch (e) {"
|
|
744
|
+
" return ((e instanceof Error) &&"
|
|
745
|
+
" (e.message == 'Exception in HostFunction: ' +"
|
|
746
|
+
" 'expected 2 args'));"
|
|
747
|
+
" }})()")
|
|
742
748
|
.getBool());
|
|
743
749
|
|
|
744
750
|
Function coolify = Function::createFromHostFunction(
|
|
@@ -755,10 +761,11 @@ TEST_P(JSITest, HostFunctionTest) {
|
|
|
755
761
|
EXPECT_TRUE(eval("coolify.name == 'coolify'").getBool());
|
|
756
762
|
EXPECT_TRUE(eval("coolify.length == 0").getBool());
|
|
757
763
|
EXPECT_TRUE(eval("coolify.bind('R&M')() == 'R&M is cool'").getBool());
|
|
758
|
-
EXPECT_TRUE(eval(
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
764
|
+
EXPECT_TRUE(eval(
|
|
765
|
+
"(function() {"
|
|
766
|
+
" var s = coolify.bind(function(){})();"
|
|
767
|
+
" return s.lastIndexOf(' is cool') == (s.length - 8);"
|
|
768
|
+
"})()")
|
|
762
769
|
.getBool());
|
|
763
770
|
|
|
764
771
|
Function lookAtMe = Function::createFromHostFunction(
|
|
@@ -887,14 +894,15 @@ TEST_P(JSITest, ValueTest) {
|
|
|
887
894
|
uint8_t utf8[] = "[null, 2, \"c\", \"emoji: \xf0\x9f\x86\x97\", {}]";
|
|
888
895
|
|
|
889
896
|
EXPECT_TRUE(
|
|
890
|
-
function(
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
897
|
+
function(
|
|
898
|
+
"function (arr) { return "
|
|
899
|
+
"Array.isArray(arr) && "
|
|
900
|
+
"arr.length == 5 && "
|
|
901
|
+
"arr[0] === null && "
|
|
902
|
+
"arr[1] == 2 && "
|
|
903
|
+
"arr[2] == 'c' && "
|
|
904
|
+
"arr[3] == 'emoji: \\uD83C\\uDD97' && "
|
|
905
|
+
"typeof arr[4] == 'object'; }")
|
|
898
906
|
.call(rt, Value::createFromJsonUtf8(rt, utf8, sizeof(utf8) - 1))
|
|
899
907
|
.getBool());
|
|
900
908
|
|
|
@@ -936,14 +944,16 @@ TEST_P(JSITest, EqualsTest) {
|
|
|
936
944
|
EXPECT_TRUE(Value::strictEquals(rt, nullptr, nullptr));
|
|
937
945
|
EXPECT_TRUE(Value::strictEquals(rt, Value::undefined(), Value()));
|
|
938
946
|
EXPECT_TRUE(Value::strictEquals(rt, rt.global(), Value(rt.global())));
|
|
939
|
-
EXPECT_FALSE(
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
+
EXPECT_FALSE(
|
|
948
|
+
Value::strictEquals(
|
|
949
|
+
rt,
|
|
950
|
+
std::numeric_limits<double>::quiet_NaN(),
|
|
951
|
+
std::numeric_limits<double>::quiet_NaN()));
|
|
952
|
+
EXPECT_FALSE(
|
|
953
|
+
Value::strictEquals(
|
|
954
|
+
rt,
|
|
955
|
+
std::numeric_limits<double>::signaling_NaN(),
|
|
956
|
+
std::numeric_limits<double>::signaling_NaN()));
|
|
947
957
|
EXPECT_TRUE(Value::strictEquals(rt, +0.0, -0.0));
|
|
948
958
|
EXPECT_TRUE(Value::strictEquals(rt, -0.0, +0.0));
|
|
949
959
|
|
|
@@ -1089,8 +1099,9 @@ TEST_P(JSITest, JSErrorDoesNotInfinitelyRecurse) {
|
|
|
1089
1099
|
return rt.global().getPropertyAsObject(rt, "NotAProperty");
|
|
1090
1100
|
};
|
|
1091
1101
|
EXPECT_EQ(
|
|
1092
|
-
function(
|
|
1093
|
-
|
|
1102
|
+
function(
|
|
1103
|
+
"function (f) { try { f(); return 'undefined'; }"
|
|
1104
|
+
"catch (e) { return typeof e; } }")
|
|
1094
1105
|
.call(
|
|
1095
1106
|
rt,
|
|
1096
1107
|
Function::createFromHostFunction(
|
|
@@ -1330,18 +1341,21 @@ TEST_P(JSITest, SymbolTest) {
|
|
|
1330
1341
|
EXPECT_EQ(eval("Symbol('sym')").getSymbol(rt).toString(rt), "Symbol(sym)");
|
|
1331
1342
|
|
|
1332
1343
|
// EqualsTest
|
|
1333
|
-
EXPECT_FALSE(
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1344
|
+
EXPECT_FALSE(
|
|
1345
|
+
Symbol::strictEquals(
|
|
1346
|
+
rt,
|
|
1347
|
+
eval("Symbol('a')").getSymbol(rt),
|
|
1348
|
+
eval("Symbol('a')").getSymbol(rt)));
|
|
1349
|
+
EXPECT_TRUE(
|
|
1350
|
+
Symbol::strictEquals(
|
|
1351
|
+
rt,
|
|
1352
|
+
eval("Symbol.for('a')").getSymbol(rt),
|
|
1353
|
+
eval("Symbol.for('a')").getSymbol(rt)));
|
|
1341
1354
|
EXPECT_FALSE(
|
|
1342
1355
|
Value::strictEquals(rt, eval("Symbol('a')"), eval("Symbol('a')")));
|
|
1343
|
-
EXPECT_TRUE(
|
|
1344
|
-
|
|
1356
|
+
EXPECT_TRUE(
|
|
1357
|
+
Value::strictEquals(
|
|
1358
|
+
rt, eval("Symbol.for('a')"), eval("Symbol.for('a')")));
|
|
1345
1359
|
EXPECT_FALSE(Value::strictEquals(rt, eval("Symbol('a')"), eval("'a'")));
|
|
1346
1360
|
}
|
|
1347
1361
|
|
|
@@ -1352,13 +1366,15 @@ TEST_P(JSITest, JSErrorTest) {
|
|
|
1352
1366
|
// Getting message property can throw
|
|
1353
1367
|
|
|
1354
1368
|
EXPECT_THROW(
|
|
1355
|
-
eval(
|
|
1356
|
-
|
|
1369
|
+
eval(
|
|
1370
|
+
"var GetMessageThrows = {get message() { throw Error('ex'); }};"
|
|
1371
|
+
"throw GetMessageThrows;"),
|
|
1357
1372
|
JSIException);
|
|
1358
1373
|
|
|
1359
1374
|
EXPECT_THROW(
|
|
1360
|
-
eval(
|
|
1361
|
-
|
|
1375
|
+
eval(
|
|
1376
|
+
"var GetMessageThrows = {get message() { throw GetMessageThrows; }};"
|
|
1377
|
+
"throw GetMessageThrows;"),
|
|
1362
1378
|
JSIException);
|
|
1363
1379
|
|
|
1364
1380
|
// Converting exception message to String can throw
|
|
@@ -1381,18 +1397,20 @@ TEST_P(JSITest, JSErrorTest) {
|
|
|
1381
1397
|
JSIException);
|
|
1382
1398
|
|
|
1383
1399
|
EXPECT_THROW(
|
|
1384
|
-
eval(
|
|
1385
|
-
|
|
1386
|
-
|
|
1400
|
+
eval(
|
|
1401
|
+
"var e = Error();"
|
|
1402
|
+
"String = function() { throw Error('ctor'); };"
|
|
1403
|
+
"throw e;"),
|
|
1387
1404
|
JSIException);
|
|
1388
1405
|
|
|
1389
1406
|
// Converting an exception message to String can return a non-String
|
|
1390
1407
|
|
|
1391
1408
|
EXPECT_THROW(
|
|
1392
|
-
eval(
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1409
|
+
eval(
|
|
1410
|
+
"String = function() { return 42; };"
|
|
1411
|
+
"var e = Error();"
|
|
1412
|
+
"e.message = 17;"
|
|
1413
|
+
"throw e;"),
|
|
1396
1414
|
JSIException);
|
|
1397
1415
|
|
|
1398
1416
|
// Exception can be non-Object
|
|
@@ -1404,8 +1422,9 @@ TEST_P(JSITest, JSErrorTest) {
|
|
|
1404
1422
|
// Converting exception with no message or stack property to String can throw
|
|
1405
1423
|
|
|
1406
1424
|
EXPECT_THROW(
|
|
1407
|
-
eval(
|
|
1408
|
-
|
|
1425
|
+
eval(
|
|
1426
|
+
"var e = {toString() { throw new Error('errstr'); }};"
|
|
1427
|
+
"throw e;"),
|
|
1409
1428
|
JSIException);
|
|
1410
1429
|
}
|
|
1411
1430
|
|