@triniwiz/nativescript-masonkit 1.0.0-alpha.5 → 1.0.0-alpha.6
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/common.d.ts +7 -9
- package/common.js +277 -552
- package/common.js.map +1 -1
- package/helpers.d.ts +32 -10
- package/helpers.js +772 -286
- package/helpers.js.map +1 -1
- package/index.android.d.ts +6 -2
- package/index.android.js +21 -3
- package/index.android.js.map +1 -1
- package/index.d.ts +64 -7
- package/index.ios.d.ts +9 -6
- package/index.ios.js +39 -25
- package/index.ios.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/include.gradle +18 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +108 -64
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +47 -20
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +10744 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +216 -128
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +47 -20
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +10744 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +10744 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +58 -21
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +43 -43
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/build.xcconfig +1 -2
- package/platforms/ios/src/MasonV8Module.h +583 -0
- package/platforms/ios/src/MasonV8Module.mm +1005 -0
- package/platforms/ios/src/{include → cpp/include}/mason_native.h +47 -20
- package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
- package/platforms/ios/src/module.modulemap +2 -2
- package/platforms/new_native_src/cpp/Caches.cpp +36 -0
- package/platforms/new_native_src/cpp/Caches.h +42 -0
- package/platforms/new_native_src/cpp/Common.h +34 -0
- package/platforms/new_native_src/cpp/ConcurrentMap.h +57 -0
- package/platforms/new_native_src/cpp/Helpers.cpp +101 -0
- package/platforms/new_native_src/cpp/Helpers.h +364 -0
- package/platforms/new_native_src/cpp/MasonImpl.cpp +68 -0
- package/platforms/new_native_src/cpp/MasonImpl.h +40 -0
- package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +89 -0
- package/platforms/new_native_src/cpp/MasonNodeImpl.h +47 -0
- package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +2181 -0
- package/platforms/new_native_src/cpp/MasonStyleImpl.h +420 -0
- package/platforms/{ios/Mason.xcframework/ios-arm64/Mason.framework/PrivateHeaders → new_native_src/cpp/include}/mason_native.h +464 -168
- package/platforms/new_native_src/cpp/include/robin_hood.h +2544 -0
- package/pods/Headers/include/APIDesign.md +72 -0
- package/pods/Headers/include/DEPS +10 -0
- package/pods/Headers/include/DIR_METADATA +11 -0
- package/pods/Headers/include/OWNERS +23 -0
- package/pods/Headers/include/cppgc/DEPS +8 -0
- package/pods/Headers/include/cppgc/OWNERS +2 -0
- package/pods/Headers/include/cppgc/README.md +133 -0
- package/pods/Headers/include/cppgc/allocation.h +310 -0
- package/pods/Headers/include/cppgc/common.h +29 -0
- package/pods/Headers/include/cppgc/cross-thread-persistent.h +465 -0
- package/pods/Headers/include/cppgc/custom-space.h +97 -0
- package/pods/Headers/include/cppgc/default-platform.h +67 -0
- package/pods/Headers/include/cppgc/ephemeron-pair.h +30 -0
- package/pods/Headers/include/cppgc/explicit-management.h +100 -0
- package/pods/Headers/include/cppgc/garbage-collected.h +106 -0
- package/pods/Headers/include/cppgc/heap-consistency.h +266 -0
- package/pods/Headers/include/cppgc/heap-state.h +82 -0
- package/pods/Headers/include/cppgc/heap-statistics.h +120 -0
- package/pods/Headers/include/cppgc/heap.h +206 -0
- package/pods/Headers/include/cppgc/internal/api-constants.h +55 -0
- package/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +48 -0
- package/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +79 -0
- package/pods/Headers/include/cppgc/internal/compiler-specific.h +38 -0
- package/pods/Headers/include/cppgc/internal/finalizer-trait.h +93 -0
- package/pods/Headers/include/cppgc/internal/gc-info.h +156 -0
- package/pods/Headers/include/cppgc/internal/logging.h +50 -0
- package/pods/Headers/include/cppgc/internal/name-trait.h +122 -0
- package/pods/Headers/include/cppgc/internal/persistent-node.h +216 -0
- package/pods/Headers/include/cppgc/internal/pointer-policies.h +186 -0
- package/pods/Headers/include/cppgc/internal/write-barrier.h +435 -0
- package/pods/Headers/include/cppgc/liveness-broker.h +77 -0
- package/pods/Headers/include/cppgc/macros.h +26 -0
- package/pods/Headers/include/cppgc/member.h +291 -0
- package/pods/Headers/include/cppgc/name-provider.h +65 -0
- package/pods/Headers/include/cppgc/object-size-trait.h +58 -0
- package/pods/Headers/include/cppgc/persistent.h +370 -0
- package/pods/Headers/include/cppgc/platform.h +156 -0
- package/pods/Headers/include/cppgc/prefinalizer.h +75 -0
- package/pods/Headers/include/cppgc/process-heap-statistics.h +36 -0
- package/pods/Headers/include/cppgc/sentinel-pointer.h +32 -0
- package/pods/Headers/include/cppgc/source-location.h +92 -0
- package/pods/Headers/include/cppgc/testing.h +106 -0
- package/pods/Headers/include/cppgc/trace-trait.h +116 -0
- package/pods/Headers/include/cppgc/type-traits.h +240 -0
- package/pods/Headers/include/cppgc/visitor.h +379 -0
- package/pods/Headers/include/js_protocol-1.2.json +936 -0
- package/pods/Headers/include/js_protocol-1.3.json +1112 -0
- package/pods/Headers/include/js_protocol.pdl +1709 -0
- package/pods/Headers/include/libffi/arm64/ffi.h +524 -0
- package/pods/Headers/include/libffi/arm64/ffitarget.h +92 -0
- package/pods/Headers/include/libffi/x86_64/ffi.h +524 -0
- package/pods/Headers/include/libffi/x86_64/ffitarget.h +147 -0
- package/pods/Headers/include/libffi.h +12 -0
- package/pods/Headers/include/libplatform/DEPS +9 -0
- package/pods/Headers/include/libplatform/libplatform-export.h +29 -0
- package/pods/Headers/include/libplatform/libplatform.h +106 -0
- package/pods/Headers/include/libplatform/v8-tracing.h +333 -0
- package/pods/Headers/include/v8-array-buffer.h +433 -0
- package/pods/Headers/include/v8-callbacks.h +397 -0
- package/pods/Headers/include/v8-container.h +129 -0
- package/pods/Headers/include/v8-context.h +407 -0
- package/pods/Headers/include/v8-cppgc.h +215 -0
- package/pods/Headers/include/v8-data.h +80 -0
- package/pods/Headers/include/v8-date.h +43 -0
- package/pods/Headers/include/v8-debug.h +168 -0
- package/pods/Headers/include/v8-embedder-heap.h +218 -0
- package/pods/Headers/include/v8-embedder-state-scope.h +51 -0
- package/pods/Headers/include/v8-exception.h +217 -0
- package/pods/Headers/include/v8-extension.h +62 -0
- package/pods/Headers/include/v8-external.h +37 -0
- package/pods/Headers/include/v8-fast-api-calls.h +939 -0
- package/pods/Headers/include/v8-forward.h +81 -0
- package/pods/Headers/include/v8-function-callback.h +475 -0
- package/pods/Headers/include/v8-function.h +125 -0
- package/pods/Headers/include/v8-initialization.h +315 -0
- package/pods/Headers/include/v8-inspector-protocol.h +13 -0
- package/pods/Headers/include/v8-inspector.h +376 -0
- package/pods/Headers/include/v8-internal.h +661 -0
- package/pods/Headers/include/v8-isolate.h +1709 -0
- package/pods/Headers/include/v8-json.h +47 -0
- package/pods/Headers/include/v8-local-handle.h +455 -0
- package/pods/Headers/include/v8-locker.h +149 -0
- package/pods/Headers/include/v8-maybe.h +137 -0
- package/pods/Headers/include/v8-memory-span.h +43 -0
- package/pods/Headers/include/v8-message.h +216 -0
- package/pods/Headers/include/v8-metrics.h +255 -0
- package/pods/Headers/include/v8-microtask-queue.h +152 -0
- package/pods/Headers/include/v8-microtask.h +28 -0
- package/pods/Headers/include/v8-object.h +775 -0
- package/pods/Headers/include/v8-persistent-handle.h +590 -0
- package/pods/Headers/include/v8-platform.h +1092 -0
- package/pods/Headers/include/v8-primitive-object.h +118 -0
- package/pods/Headers/include/v8-primitive.h +866 -0
- package/pods/Headers/include/v8-profiler.h +1198 -0
- package/pods/Headers/include/v8-promise.h +174 -0
- package/pods/Headers/include/v8-proxy.h +50 -0
- package/pods/Headers/include/v8-regexp.h +105 -0
- package/pods/Headers/include/v8-script.h +748 -0
- package/pods/Headers/include/v8-snapshot.h +196 -0
- package/pods/Headers/include/v8-statistics.h +217 -0
- package/pods/Headers/include/v8-template.h +1079 -0
- package/pods/Headers/include/v8-traced-handle.h +420 -0
- package/pods/Headers/include/v8-typed-array.h +282 -0
- package/pods/Headers/include/v8-unwinder-state.h +31 -0
- package/pods/Headers/include/v8-unwinder.h +132 -0
- package/pods/Headers/include/v8-util.h +658 -0
- package/pods/Headers/include/v8-value-serializer-version.h +24 -0
- package/pods/Headers/include/v8-value-serializer.h +279 -0
- package/pods/Headers/include/v8-value.h +526 -0
- package/pods/Headers/include/v8-version-string.h +38 -0
- package/pods/Headers/include/v8-version.h +20 -0
- package/pods/Headers/include/v8-wasm-trap-handler-posix.h +31 -0
- package/pods/Headers/include/v8-wasm-trap-handler-win.h +28 -0
- package/pods/Headers/include/v8-wasm.h +257 -0
- package/pods/Headers/include/v8-weak-callback-info.h +86 -0
- package/pods/Headers/include/v8.h +88 -0
- package/pods/Headers/include/v8config.h +605 -0
- package/pods/Headers/inspector/InspectorServer.h +20 -0
- package/pods/Headers/inspector/JsV8InspectorClient.h +66 -0
- package/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +1123 -0
- package/pods/Headers/inspector/base64.h +9 -0
- package/pods/Headers/inspector/src/base/address-region.h +95 -0
- package/pods/Headers/inspector/src/base/atomic-utils.h +219 -0
- package/pods/Headers/inspector/src/base/atomicops.h +332 -0
- package/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +89 -0
- package/pods/Headers/inspector/src/base/base-export.h +31 -0
- package/pods/Headers/inspector/src/base/bits.h +343 -0
- package/pods/Headers/inspector/src/base/build_config.h +234 -0
- package/pods/Headers/inspector/src/base/compiler-specific.h +136 -0
- package/pods/Headers/inspector/src/base/export-template.h +163 -0
- package/pods/Headers/inspector/src/base/flags.h +130 -0
- package/pods/Headers/inspector/src/base/immediate-crash.h +162 -0
- package/pods/Headers/inspector/src/base/lazy-instance.h +258 -0
- package/pods/Headers/inspector/src/base/logging.h +417 -0
- package/pods/Headers/inspector/src/base/macros.h +423 -0
- package/pods/Headers/inspector/src/base/memory.h +89 -0
- package/pods/Headers/inspector/src/base/once.h +108 -0
- package/pods/Headers/inspector/src/base/optional.h +882 -0
- package/pods/Headers/inspector/src/base/platform/mutex.h +370 -0
- package/pods/Headers/inspector/src/base/platform/platform.h +476 -0
- package/pods/Headers/inspector/src/base/platform/semaphore.h +108 -0
- package/pods/Headers/inspector/src/base/platform/v8-time.h +513 -0
- package/pods/Headers/inspector/src/base/platform/wrappers.h +73 -0
- package/pods/Headers/inspector/src/base/safe_conversions.h +389 -0
- package/pods/Headers/inspector/src/base/safe_conversions_impl.h +822 -0
- package/pods/Headers/inspector/src/base/template-utils.h +113 -0
- package/pods/Headers/inspector/src/base/v8-fallthrough.h +21 -0
- package/pods/Headers/inspector/src/common/checks.h +38 -0
- package/pods/Headers/inspector/src/common/globals.h +1842 -0
- package/pods/Headers/inspector/src/debug/debug-interface.h +667 -0
- package/pods/Headers/inspector/src/debug/interface-types.h +175 -0
- package/pods/Headers/inspector/src/init/v8.h +52 -0
- package/pods/Headers/inspector/src/inspector/custom-preview.h +24 -0
- package/pods/Headers/inspector/src/inspector/injected-script.h +251 -0
- package/pods/Headers/inspector/src/inspector/inspected-context.h +79 -0
- package/pods/Headers/inspector/src/inspector/protocol/CSS.h +2148 -0
- package/pods/Headers/inspector/src/inspector/protocol/Console.h +211 -0
- package/pods/Headers/inspector/src/inspector/protocol/DOM.h +1008 -0
- package/pods/Headers/inspector/src/inspector/protocol/Debugger.h +892 -0
- package/pods/Headers/inspector/src/inspector/protocol/Forward.h +75 -0
- package/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +346 -0
- package/pods/Headers/inspector/src/inspector/protocol/Log.h +342 -0
- package/pods/Headers/inspector/src/inspector/protocol/Network.h +2528 -0
- package/pods/Headers/inspector/src/inspector/protocol/Overlay.h +281 -0
- package/pods/Headers/inspector/src/inspector/protocol/Page.h +1189 -0
- package/pods/Headers/inspector/src/inspector/protocol/Profiler.h +1001 -0
- package/pods/Headers/inspector/src/inspector/protocol/Protocol.h +617 -0
- package/pods/Headers/inspector/src/inspector/protocol/Runtime.h +1696 -0
- package/pods/Headers/inspector/src/inspector/protocol/Schema.h +146 -0
- package/pods/Headers/inspector/src/inspector/protocol/Security.h +793 -0
- package/pods/Headers/inspector/src/inspector/remote-object-id.h +54 -0
- package/pods/Headers/inspector/src/inspector/search-util.h +26 -0
- package/pods/Headers/inspector/src/inspector/string-16.h +180 -0
- package/pods/Headers/inspector/src/inspector/string-util.h +128 -0
- package/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +48 -0
- package/pods/Headers/inspector/src/inspector/v8-console-message.h +147 -0
- package/pods/Headers/inspector/src/inspector/v8-console.h +173 -0
- package/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +62 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +248 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-id.h +44 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger-script.h +123 -0
- package/pods/Headers/inspector/src/inspector/v8-debugger.h +257 -0
- package/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +91 -0
- package/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +80 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +191 -0
- package/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +156 -0
- package/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +34 -0
- package/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +71 -0
- package/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +24 -0
- package/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +70 -0
- package/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +88 -0
- package/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +104 -0
- package/pods/Headers/inspector/src/inspector/v8-regex.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +157 -0
- package/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +38 -0
- package/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +164 -0
- package/pods/Headers/inspector/src/inspector/v8-string-conversions.h +17 -0
- package/pods/Headers/inspector/src/inspector/v8-value-utils.h +23 -0
- package/pods/Headers/inspector/src/inspector/value-mirror.h +87 -0
- package/pods/Headers/inspector/src/libplatform/default-platform.h +92 -0
- package/pods/Headers/inspector/src/logging/tracing-flags.h +50 -0
- package/pods/Headers/inspector/src/numbers/conversions.h +183 -0
- package/pods/Headers/inspector/src/tracing/trace-event.h +664 -0
- package/pods/Headers/inspector/src/utils/allocation.h +367 -0
- package/pods/Headers/inspector/src/utils/vector.h +324 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +305 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +314 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +62 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +6 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +58 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +47 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +80 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +52 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +26 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +104 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +39 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +406 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +32 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +158 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +99 -0
- package/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +139 -0
- package/pods/Headers/inspector/utils.h +32 -0
- package/pods/Headers/inspector/v8-inspector-platform.h +44 -0
- package/pods/Headers/jsi/decorator.h +762 -0
- package/pods/Headers/jsi/instrumentation.h +117 -0
- package/pods/Headers/jsi/jsi-inl.h +322 -0
- package/pods/Headers/jsi/jsi.h +1387 -0
- package/pods/Headers/jsi/jsilib.h +59 -0
- package/pods/Headers/jsi/threadsafe.h +79 -0
- package/pods/Headers/runtime/ArgConverter.h +61 -0
- package/pods/Headers/runtime/ArrayAdapter.h +13 -0
- package/pods/Headers/runtime/Caches.h +98 -0
- package/pods/Headers/runtime/ClassBuilder.h +61 -0
- package/pods/Headers/runtime/Common.h +9 -0
- package/pods/Headers/runtime/ConcurrentMap.h +55 -0
- package/pods/Headers/runtime/ConcurrentQueue.h +28 -0
- package/pods/Headers/runtime/Console.h +27 -0
- package/pods/Headers/runtime/Constants.h +15 -0
- package/pods/Headers/runtime/DataWrapper.h +671 -0
- package/pods/Headers/runtime/DictionaryAdapter.h +13 -0
- package/pods/Headers/runtime/ExtVector.h +21 -0
- package/pods/Headers/runtime/FFICall.h +105 -0
- package/pods/Headers/runtime/FastEnumerationAdapter.h +13 -0
- package/pods/Headers/runtime/FunctionReference.h +18 -0
- package/pods/Headers/runtime/Helpers.h +84 -0
- package/pods/Headers/runtime/InlineFunctions.h +16 -0
- package/pods/Headers/runtime/Interop.h +202 -0
- package/pods/Headers/runtime/KnownUnknownClassPair.h +35 -0
- package/pods/Headers/runtime/Metadata.h +981 -0
- package/pods/Headers/runtime/MetadataBuilder.h +72 -0
- package/pods/Headers/runtime/MetadataInlines.h +157 -0
- package/pods/Headers/runtime/ModuleInternal.h +59 -0
- package/pods/Headers/runtime/NSDataAdapter.h +13 -0
- package/pods/Headers/runtime/NativeScriptException.h +27 -0
- package/pods/Headers/runtime/ObjectManager.h +31 -0
- package/pods/Headers/runtime/OneByteStringResource.h +21 -0
- package/pods/Headers/runtime/Pointer.h +26 -0
- package/pods/Headers/runtime/PromiseProxy.h +15 -0
- package/pods/Headers/runtime/Reference.h +38 -0
- package/pods/Headers/runtime/Runtime.h +67 -0
- package/pods/Headers/runtime/RuntimeConfig.h +17 -0
- package/pods/Headers/runtime/SetTimeout.h +34 -0
- package/pods/Headers/runtime/SimpleAllocator.h +23 -0
- package/pods/Headers/runtime/StringHasher.h +315 -0
- package/pods/Headers/runtime/SymbolIterator.h +18 -0
- package/pods/Headers/runtime/SymbolLoader.h +27 -0
- package/pods/Headers/runtime/TNSDerivedClass.h +8 -0
- package/pods/Headers/runtime/TSHelpers.h +15 -0
- package/pods/Headers/runtime/Tasks.h +19 -0
- package/pods/Headers/runtime/UnmanagedType.h +21 -0
- package/pods/Headers/runtime/WeakRef.h +15 -0
- package/pods/Headers/runtime/Worker.h +26 -0
- package/pods/Headers/runtime/robin_hood.h +2184 -0
- package/pods/Headers/v8runtime/HostProxy.h +71 -0
- package/pods/Headers/v8runtime/JSIV8ValueConverter.h +70 -0
- package/pods/Headers/v8runtime/V8PointerValue.h +44 -0
- package/pods/Headers/v8runtime/V8Runtime.h +215 -0
- package/pods/Headers/v8runtime/V8RuntimeConfig.h +26 -0
- package/pods/Headers/v8runtime/V8RuntimeFactory.h +21 -0
- package/pods/NativeScript.podspec +68 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/PrivateHeaders/mason_native.h +0 -676
- package/platforms/ios/src/JSIModule.h +0 -217
- package/platforms/ios/src/JSIModule.mm +0 -2788
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "jsi/jsi.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook {
|
|
13
|
+
namespace jsi {
|
|
14
|
+
|
|
15
|
+
class FileBuffer : public Buffer {
|
|
16
|
+
public:
|
|
17
|
+
FileBuffer(const std::string& path);
|
|
18
|
+
~FileBuffer() override;
|
|
19
|
+
|
|
20
|
+
size_t size() const override {
|
|
21
|
+
return size_;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const uint8_t* data() const override {
|
|
25
|
+
return data_;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private:
|
|
29
|
+
size_t size_;
|
|
30
|
+
uint8_t* data_;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// A trivial implementation of PreparedJavaScript that simply stores the source
|
|
34
|
+
// buffer and URL.
|
|
35
|
+
class SourceJavaScriptPreparation final : public jsi::PreparedJavaScript,
|
|
36
|
+
public jsi::Buffer {
|
|
37
|
+
std::shared_ptr<const jsi::Buffer> buf_;
|
|
38
|
+
std::string sourceURL_;
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
SourceJavaScriptPreparation(
|
|
42
|
+
std::shared_ptr<const jsi::Buffer> buf,
|
|
43
|
+
std::string sourceURL)
|
|
44
|
+
: buf_(std::move(buf)), sourceURL_(std::move(sourceURL)) {}
|
|
45
|
+
|
|
46
|
+
const std::string& sourceURL() const {
|
|
47
|
+
return sourceURL_;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
size_t size() const override {
|
|
51
|
+
return buf_->size();
|
|
52
|
+
}
|
|
53
|
+
const uint8_t* data() const override {
|
|
54
|
+
return buf_->data();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace jsi
|
|
59
|
+
} // namespace facebook
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <mutex>
|
|
11
|
+
|
|
12
|
+
#include "jsi/decorator.h"
|
|
13
|
+
#include "jsi/jsi.h"
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace jsi {
|
|
17
|
+
|
|
18
|
+
class ThreadSafeRuntime : public Runtime {
|
|
19
|
+
public:
|
|
20
|
+
virtual void lock() const = 0;
|
|
21
|
+
virtual void unlock() const = 0;
|
|
22
|
+
virtual Runtime& getUnsafeRuntime() = 0;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
namespace detail {
|
|
26
|
+
|
|
27
|
+
template <typename R, typename L>
|
|
28
|
+
struct WithLock {
|
|
29
|
+
L lock;
|
|
30
|
+
WithLock(R& r) : lock(r) {}
|
|
31
|
+
void before() {
|
|
32
|
+
lock.lock();
|
|
33
|
+
}
|
|
34
|
+
void after() {
|
|
35
|
+
lock.unlock();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// The actual implementation of a given ThreadSafeRuntime. It's parameterized
|
|
40
|
+
// by:
|
|
41
|
+
//
|
|
42
|
+
// - R: The actual Runtime type that this wraps
|
|
43
|
+
// - L: A lock type that has three members:
|
|
44
|
+
// - L(R& r) // ctor
|
|
45
|
+
// - void lock()
|
|
46
|
+
// - void unlock()
|
|
47
|
+
template <typename R, typename L>
|
|
48
|
+
class ThreadSafeRuntimeImpl final
|
|
49
|
+
: public WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime> {
|
|
50
|
+
public:
|
|
51
|
+
template <typename... Args>
|
|
52
|
+
ThreadSafeRuntimeImpl(Args&&... args)
|
|
53
|
+
: WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime>(
|
|
54
|
+
unsafe_,
|
|
55
|
+
lock_),
|
|
56
|
+
unsafe_(std::forward<Args>(args)...),
|
|
57
|
+
lock_(unsafe_) {}
|
|
58
|
+
|
|
59
|
+
R& getUnsafeRuntime() override {
|
|
60
|
+
return WithRuntimeDecorator<WithLock<R, L>, R, ThreadSafeRuntime>::plain();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
void lock() const override {
|
|
64
|
+
lock_.before();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
void unlock() const override {
|
|
68
|
+
lock_.after();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
R unsafe_;
|
|
73
|
+
mutable WithLock<R, L> lock_;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace detail
|
|
77
|
+
|
|
78
|
+
} // namespace jsi
|
|
79
|
+
} // namespace facebook
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#ifndef ArgConverter_h
|
|
2
|
+
#define ArgConverter_h
|
|
3
|
+
|
|
4
|
+
#include <vector>
|
|
5
|
+
#include "libffi.h"
|
|
6
|
+
#include "Common.h"
|
|
7
|
+
#include "Caches.h"
|
|
8
|
+
#include "DataWrapper.h"
|
|
9
|
+
|
|
10
|
+
namespace tns {
|
|
11
|
+
|
|
12
|
+
class ArgConverter;
|
|
13
|
+
|
|
14
|
+
struct MethodCallbackWrapper {
|
|
15
|
+
public:
|
|
16
|
+
MethodCallbackWrapper(v8::Isolate* isolate, std::shared_ptr<v8::Persistent<v8::Value>> callback, const uint8_t initialParamIndex, const uint8_t paramsCount, const TypeEncoding* typeEncoding)
|
|
17
|
+
: isolate_(isolate),
|
|
18
|
+
callback_(callback),
|
|
19
|
+
initialParamIndex_(initialParamIndex),
|
|
20
|
+
paramsCount_(paramsCount),
|
|
21
|
+
typeEncoding_(typeEncoding) {
|
|
22
|
+
}
|
|
23
|
+
v8::Isolate* isolate_;
|
|
24
|
+
std::shared_ptr<v8::Persistent<v8::Value>> callback_;
|
|
25
|
+
const uint8_t initialParamIndex_;
|
|
26
|
+
const uint8_t paramsCount_;
|
|
27
|
+
const TypeEncoding* typeEncoding_;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
class ArgConverter {
|
|
31
|
+
public:
|
|
32
|
+
static void Init(v8::Local<v8::Context> context, v8::GenericNamedPropertyGetterCallback structPropertyGetter, v8::GenericNamedPropertySetterCallback structPropertySetter);
|
|
33
|
+
static v8::Local<v8::Value> Invoke(v8::Local<v8::Context> context, Class klass, v8::Local<v8::Object> receiver, V8Args& args, const MethodMeta* meta, bool isMethodCallback);
|
|
34
|
+
static v8::Local<v8::Value> ConvertArgument(v8::Local<v8::Context> context, BaseDataWrapper* wrapper, bool skipGCRegistration = false, const std::vector<std::string>& additionalProtocols = std::vector<std::string>());
|
|
35
|
+
static v8::Local<v8::Value> CreateJsWrapper(v8::Local<v8::Context> context, BaseDataWrapper* wrapper, v8::Local<v8::Object> receiver, bool skipGCRegistration = false, const std::vector<std::string>& additionalProtocols = std::vector<std::string>());
|
|
36
|
+
static std::shared_ptr<v8::Persistent<v8::Value>> CreateEmptyObject(v8::Local<v8::Context> context, bool skipGCRegistration = false);
|
|
37
|
+
static std::shared_ptr<v8::Persistent<v8::Value>> CreateEmptyStruct(v8::Local<v8::Context> context);
|
|
38
|
+
static const Meta* FindMeta(Class klass, const TypeEncoding* typeEncoding = nullptr);
|
|
39
|
+
static const Meta* GetMeta(std::string name);
|
|
40
|
+
static const ProtocolMeta* FindProtocolMeta(Protocol* protocol);
|
|
41
|
+
static void MethodCallback(ffi_cif* cif, void* retValue, void** argValues, void* userData);
|
|
42
|
+
static void SetValue(v8::Local<v8::Context> context, void* retValue, v8::Local<v8::Value> value, const TypeEncoding* typeEncoding);
|
|
43
|
+
static void ConstructObject(v8::Local<v8::Context> context, const v8::FunctionCallbackInfo<v8::Value>& info, Class klass, const InterfaceMeta* interfaceMeta = nullptr);
|
|
44
|
+
private:
|
|
45
|
+
static v8::Local<v8::Function> CreateEmptyInstanceFunction(v8::Local<v8::Context> context, v8::GenericNamedPropertyGetterCallback propertyGetter = nullptr, v8::GenericNamedPropertySetterCallback propertySetter = nullptr);
|
|
46
|
+
static std::shared_ptr<v8::Persistent<v8::Value>> CreateEmptyInstance(v8::Local<v8::Context> context, v8::Persistent<v8::Function>* ctorFunc, bool skipGCRegistration = false);
|
|
47
|
+
static void FindMethodOverloads(Class klass, std::string methodName, MemberType type, std::vector<const MethodMeta*>& overloads);
|
|
48
|
+
static const MethodMeta* FindInitializer(v8::Local<v8::Context> context, Class klass, const InterfaceMeta* interfaceMeta, const v8::FunctionCallbackInfo<v8::Value>& info, std::vector<v8::Local<v8::Value>>& args);
|
|
49
|
+
static bool CanInvoke(v8::Local<v8::Context> context, const TypeEncoding* typeEncoding, v8::Local<v8::Value> arg);
|
|
50
|
+
static bool CanInvoke(v8::Local<v8::Context> context, const MethodMeta* candidate, const v8::FunctionCallbackInfo<v8::Value>& info);
|
|
51
|
+
static std::vector<v8::Local<v8::Value>> GetInitializerArgs(v8::Local<v8::Object> obj, std::string& constructorTokens);
|
|
52
|
+
static void IndexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& args);
|
|
53
|
+
static void IndexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& args);
|
|
54
|
+
static bool IsErrorOutParameter(const TypeEncoding* typeEncoding);
|
|
55
|
+
static std::vector<const MethodMeta*> GetInitializers(Caches* cache, Class klass, const InterfaceMeta* interfaceMeta);
|
|
56
|
+
static void MethodCallbackInternal(ffi_cif* cif, void* retValue, void** argValues, void* userData);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#endif /* ArgConverter_h */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#ifndef ArrayAdapter_h
|
|
2
|
+
#define ArrayAdapter_h
|
|
3
|
+
|
|
4
|
+
#import <Foundation/NSArray.h>
|
|
5
|
+
#include "Common.h"
|
|
6
|
+
|
|
7
|
+
@interface ArrayAdapter : NSArray
|
|
8
|
+
|
|
9
|
+
-(instancetype)initWithJSObject:(v8::Local<v8::Object>)jsObject isolate:(v8::Isolate*)isolate;
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
#endif /* ArrayAdapter_h */
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#ifndef Caches_h
|
|
2
|
+
#define Caches_h
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include "ConcurrentMap.h"
|
|
7
|
+
#include "robin_hood.h"
|
|
8
|
+
#include "Common.h"
|
|
9
|
+
#include "Metadata.h"
|
|
10
|
+
|
|
11
|
+
namespace tns {
|
|
12
|
+
|
|
13
|
+
struct StructInfo;
|
|
14
|
+
|
|
15
|
+
struct pair_hash {
|
|
16
|
+
template <class T1, class T2>
|
|
17
|
+
std::size_t operator() (const std::pair<T1, T2> &pair) const {
|
|
18
|
+
return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
class Caches {
|
|
23
|
+
public:
|
|
24
|
+
class WorkerState {
|
|
25
|
+
public:
|
|
26
|
+
WorkerState(v8::Isolate* isolate, std::shared_ptr<v8::Persistent<v8::Value>> poWorker, void* userData)
|
|
27
|
+
: isolate_(isolate),
|
|
28
|
+
poWorker_(poWorker),
|
|
29
|
+
userData_(userData) {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
v8::Isolate* GetIsolate() {
|
|
33
|
+
return this->isolate_;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
std::shared_ptr<v8::Persistent<v8::Value>> GetWorker() {
|
|
37
|
+
return this->poWorker_;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void* UserData() {
|
|
41
|
+
return this->userData_;
|
|
42
|
+
}
|
|
43
|
+
private:
|
|
44
|
+
v8::Isolate* isolate_;
|
|
45
|
+
std::shared_ptr<v8::Persistent<v8::Value>> poWorker_;
|
|
46
|
+
void* userData_;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
Caches(v8::Isolate* isolate);
|
|
50
|
+
~Caches();
|
|
51
|
+
|
|
52
|
+
static std::shared_ptr<ConcurrentMap<std::string, const Meta*>> Metadata;
|
|
53
|
+
static std::shared_ptr<ConcurrentMap<int, std::shared_ptr<Caches::WorkerState>>> Workers;
|
|
54
|
+
|
|
55
|
+
static std::shared_ptr<Caches> Get(v8::Isolate* isolate);
|
|
56
|
+
static void Remove(v8::Isolate* isolate);
|
|
57
|
+
|
|
58
|
+
void SetContext(v8::Local<v8::Context> context);
|
|
59
|
+
v8::Local<v8::Context> GetContext();
|
|
60
|
+
|
|
61
|
+
robin_hood::unordered_map<const Meta*, std::unique_ptr<v8::Persistent<v8::Value>>> Prototypes;
|
|
62
|
+
robin_hood::unordered_map<std::string, std::unique_ptr<v8::Persistent<v8::Object>>> ClassPrototypes;
|
|
63
|
+
robin_hood::unordered_map<const BaseClassMeta*, std::unique_ptr<v8::Persistent<v8::FunctionTemplate>>> CtorFuncTemplates;
|
|
64
|
+
robin_hood::unordered_map<std::string, std::unique_ptr<v8::Persistent<v8::Function>>> CtorFuncs;
|
|
65
|
+
robin_hood::unordered_map<std::string, std::unique_ptr<v8::Persistent<v8::Function>>> ProtocolCtorFuncs;
|
|
66
|
+
robin_hood::unordered_map<std::string, std::unique_ptr<v8::Persistent<v8::Function>>> StructConstructorFunctions;
|
|
67
|
+
robin_hood::unordered_map<BinaryTypeEncodingType, std::unique_ptr<v8::Persistent<v8::Object>>> PrimitiveInteropTypes;
|
|
68
|
+
robin_hood::unordered_map<std::string, std::unique_ptr<v8::Persistent<v8::Function>>> CFunctions;
|
|
69
|
+
|
|
70
|
+
robin_hood::unordered_map<id, std::shared_ptr<v8::Persistent<v8::Value>>> Instances;
|
|
71
|
+
robin_hood::unordered_map<std::pair<void*, std::string>, std::shared_ptr<v8::Persistent<v8::Value>>, pair_hash> StructInstances;
|
|
72
|
+
robin_hood::unordered_map<const void*, std::shared_ptr<v8::Persistent<v8::Object>>> PointerInstances;
|
|
73
|
+
|
|
74
|
+
std::function<v8::Local<v8::FunctionTemplate>(v8::Local<v8::Context>, const BaseClassMeta*, KnownUnknownClassPair, const std::vector<std::string>&)> ObjectCtorInitializer;
|
|
75
|
+
std::function<v8::Local<v8::Function>(v8::Local<v8::Context>, StructInfo)> StructCtorInitializer;
|
|
76
|
+
robin_hood::unordered_map<std::string, double> Timers;
|
|
77
|
+
robin_hood::unordered_map<const InterfaceMeta*, std::vector<const MethodMeta*>> Initializers;
|
|
78
|
+
|
|
79
|
+
std::unique_ptr<v8::Persistent<v8::Function>> EmptyObjCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
80
|
+
std::unique_ptr<v8::Persistent<v8::Function>> EmptyStructCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
81
|
+
std::unique_ptr<v8::Persistent<v8::Function>> SliceFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
82
|
+
std::unique_ptr<v8::Persistent<v8::Function>> OriginalExtendsFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
83
|
+
std::unique_ptr<v8::Persistent<v8::Function>> WeakRefGetterFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
84
|
+
std::unique_ptr<v8::Persistent<v8::Function>> WeakRefClearFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
85
|
+
std::unique_ptr<v8::Persistent<v8::Function>> SmartJSONStringifyFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
86
|
+
std::unique_ptr<v8::Persistent<v8::Function>> InteropReferenceCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
87
|
+
std::unique_ptr<v8::Persistent<v8::Function>> PointerCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
88
|
+
std::unique_ptr<v8::Persistent<v8::Function>> FunctionReferenceCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
89
|
+
std::unique_ptr<v8::Persistent<v8::Function>> UnmanagedTypeCtorFunc = std::unique_ptr<v8::Persistent<v8::Function>>(nullptr);
|
|
90
|
+
private:
|
|
91
|
+
static std::shared_ptr<ConcurrentMap<v8::Isolate*, std::shared_ptr<Caches>>> perIsolateCaches_;
|
|
92
|
+
v8::Isolate* isolate_;
|
|
93
|
+
std::shared_ptr<v8::Persistent<v8::Context>> context_;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#endif /* Caches_h */
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#ifndef ClassBuilder_h
|
|
2
|
+
#define ClassBuilder_h
|
|
3
|
+
|
|
4
|
+
#include "Common.h"
|
|
5
|
+
#include "Metadata.h"
|
|
6
|
+
|
|
7
|
+
namespace tns {
|
|
8
|
+
|
|
9
|
+
struct PropertyCallbackContext {
|
|
10
|
+
public:
|
|
11
|
+
PropertyCallbackContext(v8::Isolate* isolate, std::shared_ptr<v8::Persistent<v8::Function>> callback, std::shared_ptr<v8::Persistent<v8::Object>> implementationObject, const PropertyMeta* meta)
|
|
12
|
+
: isolate_(isolate),
|
|
13
|
+
callback_(callback),
|
|
14
|
+
implementationObject_(implementationObject),
|
|
15
|
+
meta_(meta) {
|
|
16
|
+
}
|
|
17
|
+
v8::Isolate* isolate_;
|
|
18
|
+
std::shared_ptr<v8::Persistent<v8::Function>> callback_;
|
|
19
|
+
std::shared_ptr<v8::Persistent<v8::Object>> implementationObject_;
|
|
20
|
+
const PropertyMeta* meta_;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
class ClassBuilder {
|
|
24
|
+
public:
|
|
25
|
+
static v8::Local<v8::FunctionTemplate> GetExtendFunction(v8::Isolate* isolate, const InterfaceMeta* interfaceMeta);
|
|
26
|
+
static Class GetExtendedClass(std::string baseClassName, std::string staticClassName);
|
|
27
|
+
|
|
28
|
+
static void RegisterBaseTypeScriptExtendsFunction(v8::Local<v8::Context> context);
|
|
29
|
+
static void RegisterNativeTypeScriptExtendsFunction(v8::Local<v8::Context> context);
|
|
30
|
+
static std::string GetTypeEncoding(const TypeEncoding* typeEncoding, int argsCount);
|
|
31
|
+
private:
|
|
32
|
+
static unsigned long long classNameCounter_;
|
|
33
|
+
|
|
34
|
+
static void ExtendCallback(const v8::FunctionCallbackInfo<v8::Value>& info);
|
|
35
|
+
static void SuperAccessorGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info);
|
|
36
|
+
static void ExtendedClassConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info);
|
|
37
|
+
|
|
38
|
+
static void ExposeDynamicMethods(v8::Local<v8::Context> context, Class extendedClass, v8::Local<v8::Value> exposedMethods, v8::Local<v8::Value> exposedProtocols, v8::Local<v8::Object> implementationObject);
|
|
39
|
+
static void ExposeDynamicMembers(v8::Local<v8::Context> context, Class extendedClass, v8::Local<v8::Object> implementationObject, v8::Local<v8::Object> nativeSignature);
|
|
40
|
+
static void VisitMethods(Class extendedClass, std::string methodName, const BaseClassMeta* meta, std::vector<const MethodMeta*>& methodMetas, std::vector<const ProtocolMeta*> exposedProtocols);
|
|
41
|
+
static void VisitProperties(std::string propertyName, const BaseClassMeta* meta, std::vector<const PropertyMeta*>& propertyMetas, std::vector<const ProtocolMeta*> exposedProtocols);
|
|
42
|
+
static void ExposeProperties(v8::Isolate* isolate, Class extendedClass, std::vector<const PropertyMeta*> propertyMetas, v8::Local<v8::Object> implementationObject, v8::Local<v8::Value> getter, v8::Local<v8::Value> setter);
|
|
43
|
+
static std::string GetTypeEncoding(const TypeEncoding* typeEncoding);
|
|
44
|
+
static BinaryTypeEncodingType GetTypeEncodingType(v8::Isolate* isolate, v8::Local<v8::Value> value);
|
|
45
|
+
static IMP FindNotOverridenMethod(Class klass, SEL method);
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
struct CacheItem {
|
|
49
|
+
public:
|
|
50
|
+
CacheItem(const InterfaceMeta* meta, id data)
|
|
51
|
+
: meta_(meta),
|
|
52
|
+
data_(data) {
|
|
53
|
+
}
|
|
54
|
+
const InterfaceMeta* meta_;
|
|
55
|
+
id data_;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#endif /* ClassBuilder_h */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#ifndef ConcurrentMap_h
|
|
2
|
+
#define ConcurrentMap_h
|
|
3
|
+
|
|
4
|
+
#include <shared_mutex>
|
|
5
|
+
#include "robin_hood.h"
|
|
6
|
+
|
|
7
|
+
namespace tns {
|
|
8
|
+
|
|
9
|
+
template<class TKey, class TValue>
|
|
10
|
+
class ConcurrentMap {
|
|
11
|
+
public:
|
|
12
|
+
void Insert(TKey& key, TValue value) {
|
|
13
|
+
std::lock_guard<std::mutex> writerLock(this->containerMutex_);
|
|
14
|
+
this->container_[key] = value;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
TValue Get(TKey& key) {
|
|
18
|
+
bool found;
|
|
19
|
+
return this->Get(key, found);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
TValue Get(TKey& key, bool& found) {
|
|
23
|
+
// std::shared_lock<std::shared_timed_mutex> readerLock(this->containerMutex_);
|
|
24
|
+
std::lock_guard<std::mutex> writerLock(this->containerMutex_);
|
|
25
|
+
auto it = this->container_.find(key);
|
|
26
|
+
found = it != this->container_.end();
|
|
27
|
+
if (found) {
|
|
28
|
+
return it->second;
|
|
29
|
+
}
|
|
30
|
+
return nullptr;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
bool ContainsKey(TKey& key) {
|
|
34
|
+
// std::shared_lock<std::shared_timed_mutex> readerLock(this->containerMutex_);
|
|
35
|
+
std::lock_guard<std::mutex> writerLock(this->containerMutex_);
|
|
36
|
+
auto it = this->container_.find(key);
|
|
37
|
+
return it != this->container_.end();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void Remove(TKey& key) {
|
|
41
|
+
std::lock_guard<std::mutex> writerLock(this->containerMutex_);
|
|
42
|
+
this->container_.erase(key);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ConcurrentMap() = default;
|
|
46
|
+
ConcurrentMap(const ConcurrentMap&) = delete;
|
|
47
|
+
ConcurrentMap& operator=(const ConcurrentMap&) = delete;
|
|
48
|
+
private:
|
|
49
|
+
std::mutex containerMutex_;
|
|
50
|
+
robin_hood::unordered_map<TKey, TValue> container_;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#endif /* ConcurrentMap_h */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#ifndef ConcurrentQueue_h
|
|
2
|
+
#define ConcurrentQueue_h
|
|
3
|
+
|
|
4
|
+
#include <CoreFoundation/CoreFoundation.h>
|
|
5
|
+
#include <vector>
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <queue>
|
|
8
|
+
#include <mutex>
|
|
9
|
+
|
|
10
|
+
namespace tns {
|
|
11
|
+
|
|
12
|
+
struct ConcurrentQueue {
|
|
13
|
+
public:
|
|
14
|
+
void Initialize(CFRunLoopRef runLoop, void (*performWork)(void*), void* info);
|
|
15
|
+
void Push(std::string message);
|
|
16
|
+
std::vector<std::string> PopAll();
|
|
17
|
+
void Terminate();
|
|
18
|
+
private:
|
|
19
|
+
std::queue<std::string> messagesQueue_;
|
|
20
|
+
CFRunLoopSourceRef runLoopTasksSource_ = nullptr;
|
|
21
|
+
CFRunLoopRef runLoop_ = nullptr;
|
|
22
|
+
std::mutex mutex_;
|
|
23
|
+
void SignalAndWakeUp();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#endif /* ConcurrentQueue_h */
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#ifndef Console_h
|
|
2
|
+
#define Console_h
|
|
3
|
+
|
|
4
|
+
#include "Common.h"
|
|
5
|
+
#include <string>
|
|
6
|
+
|
|
7
|
+
namespace tns {
|
|
8
|
+
|
|
9
|
+
class Console {
|
|
10
|
+
public:
|
|
11
|
+
static void Init(v8::Local<v8::Context> context);
|
|
12
|
+
private:
|
|
13
|
+
static void AttachLogFunction(v8::Local<v8::Context> context, v8::Local<v8::Object> console, const std::string name, v8::FunctionCallback callback = Console::LogCallback);
|
|
14
|
+
static void LogCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
15
|
+
static void AssertCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
16
|
+
static void DirCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
17
|
+
static void TimeCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
18
|
+
static void TimeEndCallback(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
19
|
+
static std::string BuildStringFromArgs(const v8::FunctionCallbackInfo<v8::Value>& args, int startingIndex = 0);
|
|
20
|
+
static const v8::Local<v8::String> BuildStringFromArg(v8::Local<v8::Context> context, const v8::Local<v8::Value>& val);
|
|
21
|
+
static const v8::Local<v8::String> TransformJSObject(v8::Local<v8::Object> object);
|
|
22
|
+
static const std::string VerbosityToInspectorVerbosity(const std::string level);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#endif /* Console_h */
|