BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/React/CxxModule
Run
Logout
Edit File
Size: 3.04 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/React/CxxModule/RCTCxxUtils.mm
Text
Base64
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "RCTCxxUtils.h" #import <React/RCTFollyConvert.h> #import <React/RCTModuleData.h> #import <React/RCTUtils.h> #import <cxxreact/CxxNativeModule.h> #import <jsi/jsi.h> #import "DispatchMessageQueueThread.h" #import "RCTCxxModule.h" #import "RCTNativeModule.h" namespace facebook::react { using facebook::jsi::JSError; std::vector<std::unique_ptr<NativeModule>> createNativeModules(NSArray<RCTModuleData *> *modules, RCTBridge *bridge, const std::shared_ptr<Instance> &instance) { std::vector<std::unique_ptr<NativeModule>> nativeModules; for (RCTModuleData *moduleData in modules) { if ([moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) { nativeModules.emplace_back(std::make_unique<CxxNativeModule>( instance, [moduleData.name UTF8String], [moduleData] { return [(RCTCxxModule *)(moduleData.instance) createModule]; }, std::make_shared<DispatchMessageQueueThread>(moduleData))); } else { nativeModules.emplace_back(std::make_unique<RCTNativeModule>(bridge, moduleData)); } } return nativeModules; } static NSError *errorWithException(const std::exception &e) { NSString *msg = @(e.what()); NSMutableDictionary *errorInfo = [NSMutableDictionary dictionary]; const auto *jsError = dynamic_cast<const JSError *>(&e); if (jsError) { errorInfo[RCTJSRawStackTraceKey] = @(jsError->getStack().c_str()); msg = [@"Unhandled JS Exception: " stringByAppendingString:msg]; } NSError *nestedError; try { std::rethrow_if_nested(e); } catch (const std::exception &e) { nestedError = errorWithException(e); } catch (...) { } if (nestedError) { msg = [NSString stringWithFormat:@"%@\n\n%@", msg, [nestedError localizedDescription]]; } errorInfo[NSLocalizedDescriptionKey] = msg; return [NSError errorWithDomain:RCTErrorDomain code:1 userInfo:errorInfo]; } NSError *tryAndReturnError(const std::function<void()> &func) { try { @try { func(); return nil; } @catch (NSException *exception) { return RCTErrorWithNSException(exception); } @catch (id exception) { // This will catch any other ObjC exception, but no C++ exceptions return RCTErrorWithMessage(@"non-std ObjC Exception"); } } catch (const std::exception &ex) { return errorWithException(ex); } catch (...) { // On a 64-bit platform, this would catch ObjC exceptions, too, but not on // 32-bit platforms, so we catch those with id exceptions above. return RCTErrorWithMessage(@"non-std C++ exception"); } } NSString *deriveSourceURL(NSURL *url) { NSString *sourceUrl; if (url.isFileURL) { // Url will contain only path to resource (i.g. file:// will be removed) sourceUrl = url.path; } else { // Url will include protocol (e.g. http://) sourceUrl = url.absoluteString; } return sourceUrl ?: @""; } } // namespace facebook::react
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
DispatchMessageQueueThread.h
1.25 KB
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxMethod.h
449 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxMethod.mm
4.06 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxModule.h
843 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxModule.mm
1.85 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxUtils.h
670 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTCxxUtils.mm
3.04 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTNativeModule.h
923 B
lrw-r--r--
2025-03-28 11:04:41
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RCTNativeModule.mm
7.61 KB
lrw-r--r--
2025-03-28 11:04:43
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).