@triniwiz/nativescript-masonkit 1.0.0-alpha.8 → 1.0.0-beta.0

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.
Files changed (397) hide show
  1. package/button/index.android.d.ts +13 -0
  2. package/button/index.android.js +56 -0
  3. package/button/index.android.js.map +1 -0
  4. package/button/index.ios.d.ts +21 -0
  5. package/button/index.ios.js +216 -0
  6. package/button/index.ios.js.map +1 -0
  7. package/common.d.ts +78 -33
  8. package/common.js +1121 -251
  9. package/common.js.map +1 -1
  10. package/img/index.android.d.ts +10 -0
  11. package/img/index.android.js +40 -0
  12. package/img/index.android.js.map +1 -0
  13. package/img/index.ios.d.ts +13 -0
  14. package/img/index.ios.js +102 -0
  15. package/img/index.ios.js.map +1 -0
  16. package/index.android.d.ts +6 -34
  17. package/index.android.js +6 -139
  18. package/index.android.js.map +1 -1
  19. package/index.d.ts +88 -60
  20. package/index.ios.d.ts +6 -48
  21. package/index.ios.js +6 -355
  22. package/index.ios.js.map +1 -1
  23. package/package.json +5 -2
  24. package/platforms/android/include.gradle +5 -1
  25. package/platforms/android/masonkit-release.aar +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +794 -284
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason.h +0 -5
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/NSObject+MasonElement_Defaults.h +100 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +118 -93
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +58079 -23135
  34. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +1234 -255
  35. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +1234 -255
  37. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4252 -1932
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +1588 -568
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason.h +0 -5
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/NSObject+MasonElement_Defaults.h +100 -0
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +118 -93
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +58076 -23132
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1211 -232
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1211 -232
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +58076 -23132
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1211 -232
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  54. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1211 -232
  55. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +31 -31
  56. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  57. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +4246 -1932
  58. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +4124 -1883
  59. package/scroll/index.android.d.ts +12 -0
  60. package/scroll/index.android.js +50 -0
  61. package/scroll/index.android.js.map +1 -0
  62. package/scroll/index.ios.d.ts +14 -0
  63. package/scroll/index.ios.js +120 -0
  64. package/scroll/index.ios.js.map +1 -0
  65. package/style.d.ts +110 -53
  66. package/style.js +1176 -110
  67. package/style.js.map +1 -1
  68. package/text/index.android.d.ts +30 -0
  69. package/text/index.android.js +124 -0
  70. package/text/index.android.js.map +1 -0
  71. package/text/index.ios.d.ts +38 -0
  72. package/text/index.ios.js +251 -0
  73. package/text/index.ios.js.map +1 -0
  74. package/tree/index.android.d.ts +28 -0
  75. package/tree/index.android.js +77 -0
  76. package/tree/index.android.js.map +1 -0
  77. package/tree/index.ios.d.ts +29 -0
  78. package/tree/index.ios.js +76 -0
  79. package/tree/index.ios.js.map +1 -0
  80. package/utils/index.android.d.ts +187 -0
  81. package/utils/index.android.js +514 -0
  82. package/utils/index.android.js.map +1 -0
  83. package/utils/index.ios.d.ts +198 -0
  84. package/utils/index.ios.js +710 -0
  85. package/utils/index.ios.js.map +1 -0
  86. package/view/index.android.d.ts +12 -0
  87. package/view/index.android.js +50 -0
  88. package/view/index.android.js.map +1 -0
  89. package/view/index.ios.d.ts +16 -0
  90. package/view/index.ios.js +124 -0
  91. package/view/index.ios.js.map +1 -0
  92. package/web.d.ts +55 -0
  93. package/web.js +189 -0
  94. package/web.js.map +1 -0
  95. package/helpers.d.ts +0 -255
  96. package/helpers.js +0 -1318
  97. package/helpers.js.map +0 -1
  98. package/node.d.ts +0 -2
  99. package/node.js +0 -3
  100. package/node.js.map +0 -1
  101. package/platforms/ios/Podfile +0 -1
  102. package/platforms/ios/build.xcconfig +0 -5
  103. package/platforms/ios/prebuild.sh +0 -101
  104. package/platforms/new_native_src/cpp/Caches.cpp +0 -36
  105. package/platforms/new_native_src/cpp/Caches.h +0 -42
  106. package/platforms/new_native_src/cpp/Common.h +0 -34
  107. package/platforms/new_native_src/cpp/ConcurrentMap.h +0 -57
  108. package/platforms/new_native_src/cpp/Helpers.cpp +0 -101
  109. package/platforms/new_native_src/cpp/Helpers.h +0 -364
  110. package/platforms/new_native_src/cpp/MasonImpl.cpp +0 -68
  111. package/platforms/new_native_src/cpp/MasonImpl.h +0 -40
  112. package/platforms/new_native_src/cpp/MasonNodeImpl.cpp +0 -89
  113. package/platforms/new_native_src/cpp/MasonNodeImpl.h +0 -47
  114. package/platforms/new_native_src/cpp/MasonStyleImpl.cpp +0 -2181
  115. package/platforms/new_native_src/cpp/MasonStyleImpl.h +0 -420
  116. package/platforms/new_native_src/cpp/include/mason_native.h +0 -972
  117. package/platforms/new_native_src/cpp/include/robin_hood.h +0 -2544
  118. package/src-native/pods/Headers/include/APIDesign.md +0 -72
  119. package/src-native/pods/Headers/include/DEPS +0 -10
  120. package/src-native/pods/Headers/include/DIR_METADATA +0 -11
  121. package/src-native/pods/Headers/include/OWNERS +0 -23
  122. package/src-native/pods/Headers/include/cppgc/DEPS +0 -8
  123. package/src-native/pods/Headers/include/cppgc/OWNERS +0 -2
  124. package/src-native/pods/Headers/include/cppgc/README.md +0 -133
  125. package/src-native/pods/Headers/include/cppgc/allocation.h +0 -310
  126. package/src-native/pods/Headers/include/cppgc/common.h +0 -29
  127. package/src-native/pods/Headers/include/cppgc/cross-thread-persistent.h +0 -465
  128. package/src-native/pods/Headers/include/cppgc/custom-space.h +0 -97
  129. package/src-native/pods/Headers/include/cppgc/default-platform.h +0 -67
  130. package/src-native/pods/Headers/include/cppgc/ephemeron-pair.h +0 -30
  131. package/src-native/pods/Headers/include/cppgc/explicit-management.h +0 -100
  132. package/src-native/pods/Headers/include/cppgc/garbage-collected.h +0 -106
  133. package/src-native/pods/Headers/include/cppgc/heap-consistency.h +0 -266
  134. package/src-native/pods/Headers/include/cppgc/heap-state.h +0 -82
  135. package/src-native/pods/Headers/include/cppgc/heap-statistics.h +0 -120
  136. package/src-native/pods/Headers/include/cppgc/heap.h +0 -206
  137. package/src-native/pods/Headers/include/cppgc/internal/api-constants.h +0 -55
  138. package/src-native/pods/Headers/include/cppgc/internal/atomic-entry-flag.h +0 -48
  139. package/src-native/pods/Headers/include/cppgc/internal/caged-heap-local-data.h +0 -79
  140. package/src-native/pods/Headers/include/cppgc/internal/compiler-specific.h +0 -38
  141. package/src-native/pods/Headers/include/cppgc/internal/finalizer-trait.h +0 -93
  142. package/src-native/pods/Headers/include/cppgc/internal/gc-info.h +0 -156
  143. package/src-native/pods/Headers/include/cppgc/internal/logging.h +0 -50
  144. package/src-native/pods/Headers/include/cppgc/internal/name-trait.h +0 -122
  145. package/src-native/pods/Headers/include/cppgc/internal/persistent-node.h +0 -216
  146. package/src-native/pods/Headers/include/cppgc/internal/pointer-policies.h +0 -186
  147. package/src-native/pods/Headers/include/cppgc/internal/write-barrier.h +0 -435
  148. package/src-native/pods/Headers/include/cppgc/liveness-broker.h +0 -77
  149. package/src-native/pods/Headers/include/cppgc/macros.h +0 -26
  150. package/src-native/pods/Headers/include/cppgc/member.h +0 -291
  151. package/src-native/pods/Headers/include/cppgc/name-provider.h +0 -65
  152. package/src-native/pods/Headers/include/cppgc/object-size-trait.h +0 -58
  153. package/src-native/pods/Headers/include/cppgc/persistent.h +0 -370
  154. package/src-native/pods/Headers/include/cppgc/platform.h +0 -156
  155. package/src-native/pods/Headers/include/cppgc/prefinalizer.h +0 -75
  156. package/src-native/pods/Headers/include/cppgc/process-heap-statistics.h +0 -36
  157. package/src-native/pods/Headers/include/cppgc/sentinel-pointer.h +0 -32
  158. package/src-native/pods/Headers/include/cppgc/source-location.h +0 -92
  159. package/src-native/pods/Headers/include/cppgc/testing.h +0 -106
  160. package/src-native/pods/Headers/include/cppgc/trace-trait.h +0 -116
  161. package/src-native/pods/Headers/include/cppgc/type-traits.h +0 -240
  162. package/src-native/pods/Headers/include/cppgc/visitor.h +0 -379
  163. package/src-native/pods/Headers/include/js_protocol-1.2.json +0 -936
  164. package/src-native/pods/Headers/include/js_protocol-1.3.json +0 -1112
  165. package/src-native/pods/Headers/include/js_protocol.pdl +0 -1709
  166. package/src-native/pods/Headers/include/libffi/arm64/ffi.h +0 -524
  167. package/src-native/pods/Headers/include/libffi/arm64/ffitarget.h +0 -92
  168. package/src-native/pods/Headers/include/libffi/x86_64/ffi.h +0 -524
  169. package/src-native/pods/Headers/include/libffi/x86_64/ffitarget.h +0 -147
  170. package/src-native/pods/Headers/include/libffi.h +0 -12
  171. package/src-native/pods/Headers/include/libplatform/DEPS +0 -9
  172. package/src-native/pods/Headers/include/libplatform/libplatform-export.h +0 -29
  173. package/src-native/pods/Headers/include/libplatform/libplatform.h +0 -106
  174. package/src-native/pods/Headers/include/libplatform/v8-tracing.h +0 -333
  175. package/src-native/pods/Headers/include/v8-array-buffer.h +0 -433
  176. package/src-native/pods/Headers/include/v8-callbacks.h +0 -397
  177. package/src-native/pods/Headers/include/v8-container.h +0 -129
  178. package/src-native/pods/Headers/include/v8-context.h +0 -407
  179. package/src-native/pods/Headers/include/v8-cppgc.h +0 -215
  180. package/src-native/pods/Headers/include/v8-data.h +0 -80
  181. package/src-native/pods/Headers/include/v8-date.h +0 -43
  182. package/src-native/pods/Headers/include/v8-debug.h +0 -168
  183. package/src-native/pods/Headers/include/v8-embedder-heap.h +0 -218
  184. package/src-native/pods/Headers/include/v8-embedder-state-scope.h +0 -51
  185. package/src-native/pods/Headers/include/v8-exception.h +0 -217
  186. package/src-native/pods/Headers/include/v8-extension.h +0 -62
  187. package/src-native/pods/Headers/include/v8-external.h +0 -37
  188. package/src-native/pods/Headers/include/v8-fast-api-calls.h +0 -939
  189. package/src-native/pods/Headers/include/v8-forward.h +0 -81
  190. package/src-native/pods/Headers/include/v8-function-callback.h +0 -475
  191. package/src-native/pods/Headers/include/v8-function.h +0 -125
  192. package/src-native/pods/Headers/include/v8-initialization.h +0 -315
  193. package/src-native/pods/Headers/include/v8-inspector-protocol.h +0 -13
  194. package/src-native/pods/Headers/include/v8-inspector.h +0 -376
  195. package/src-native/pods/Headers/include/v8-internal.h +0 -661
  196. package/src-native/pods/Headers/include/v8-isolate.h +0 -1709
  197. package/src-native/pods/Headers/include/v8-json.h +0 -47
  198. package/src-native/pods/Headers/include/v8-local-handle.h +0 -455
  199. package/src-native/pods/Headers/include/v8-locker.h +0 -149
  200. package/src-native/pods/Headers/include/v8-maybe.h +0 -137
  201. package/src-native/pods/Headers/include/v8-memory-span.h +0 -43
  202. package/src-native/pods/Headers/include/v8-message.h +0 -216
  203. package/src-native/pods/Headers/include/v8-metrics.h +0 -255
  204. package/src-native/pods/Headers/include/v8-microtask-queue.h +0 -152
  205. package/src-native/pods/Headers/include/v8-microtask.h +0 -28
  206. package/src-native/pods/Headers/include/v8-object.h +0 -775
  207. package/src-native/pods/Headers/include/v8-persistent-handle.h +0 -590
  208. package/src-native/pods/Headers/include/v8-platform.h +0 -1092
  209. package/src-native/pods/Headers/include/v8-primitive-object.h +0 -118
  210. package/src-native/pods/Headers/include/v8-primitive.h +0 -866
  211. package/src-native/pods/Headers/include/v8-profiler.h +0 -1198
  212. package/src-native/pods/Headers/include/v8-promise.h +0 -174
  213. package/src-native/pods/Headers/include/v8-proxy.h +0 -50
  214. package/src-native/pods/Headers/include/v8-regexp.h +0 -105
  215. package/src-native/pods/Headers/include/v8-script.h +0 -748
  216. package/src-native/pods/Headers/include/v8-snapshot.h +0 -196
  217. package/src-native/pods/Headers/include/v8-statistics.h +0 -217
  218. package/src-native/pods/Headers/include/v8-template.h +0 -1079
  219. package/src-native/pods/Headers/include/v8-traced-handle.h +0 -420
  220. package/src-native/pods/Headers/include/v8-typed-array.h +0 -282
  221. package/src-native/pods/Headers/include/v8-unwinder-state.h +0 -31
  222. package/src-native/pods/Headers/include/v8-unwinder.h +0 -132
  223. package/src-native/pods/Headers/include/v8-util.h +0 -658
  224. package/src-native/pods/Headers/include/v8-value-serializer-version.h +0 -24
  225. package/src-native/pods/Headers/include/v8-value-serializer.h +0 -279
  226. package/src-native/pods/Headers/include/v8-value.h +0 -526
  227. package/src-native/pods/Headers/include/v8-version-string.h +0 -38
  228. package/src-native/pods/Headers/include/v8-version.h +0 -20
  229. package/src-native/pods/Headers/include/v8-wasm-trap-handler-posix.h +0 -31
  230. package/src-native/pods/Headers/include/v8-wasm-trap-handler-win.h +0 -28
  231. package/src-native/pods/Headers/include/v8-wasm.h +0 -257
  232. package/src-native/pods/Headers/include/v8-weak-callback-info.h +0 -86
  233. package/src-native/pods/Headers/include/v8.h +0 -88
  234. package/src-native/pods/Headers/include/v8config.h +0 -605
  235. package/src-native/pods/Headers/inspector/InspectorServer.h +0 -20
  236. package/src-native/pods/Headers/inspector/JsV8InspectorClient.h +0 -66
  237. package/src-native/pods/Headers/inspector/base/trace_event/common/trace_event_common.h +0 -1123
  238. package/src-native/pods/Headers/inspector/base64.h +0 -9
  239. package/src-native/pods/Headers/inspector/src/base/address-region.h +0 -95
  240. package/src-native/pods/Headers/inspector/src/base/atomic-utils.h +0 -219
  241. package/src-native/pods/Headers/inspector/src/base/atomicops.h +0 -332
  242. package/src-native/pods/Headers/inspector/src/base/atomicops_internals_atomicword_compat.h +0 -89
  243. package/src-native/pods/Headers/inspector/src/base/base-export.h +0 -31
  244. package/src-native/pods/Headers/inspector/src/base/bits.h +0 -343
  245. package/src-native/pods/Headers/inspector/src/base/build_config.h +0 -234
  246. package/src-native/pods/Headers/inspector/src/base/compiler-specific.h +0 -136
  247. package/src-native/pods/Headers/inspector/src/base/export-template.h +0 -163
  248. package/src-native/pods/Headers/inspector/src/base/flags.h +0 -130
  249. package/src-native/pods/Headers/inspector/src/base/immediate-crash.h +0 -162
  250. package/src-native/pods/Headers/inspector/src/base/lazy-instance.h +0 -258
  251. package/src-native/pods/Headers/inspector/src/base/logging.h +0 -417
  252. package/src-native/pods/Headers/inspector/src/base/macros.h +0 -423
  253. package/src-native/pods/Headers/inspector/src/base/memory.h +0 -89
  254. package/src-native/pods/Headers/inspector/src/base/once.h +0 -108
  255. package/src-native/pods/Headers/inspector/src/base/optional.h +0 -882
  256. package/src-native/pods/Headers/inspector/src/base/platform/mutex.h +0 -370
  257. package/src-native/pods/Headers/inspector/src/base/platform/platform.h +0 -476
  258. package/src-native/pods/Headers/inspector/src/base/platform/semaphore.h +0 -108
  259. package/src-native/pods/Headers/inspector/src/base/platform/v8-time.h +0 -513
  260. package/src-native/pods/Headers/inspector/src/base/platform/wrappers.h +0 -73
  261. package/src-native/pods/Headers/inspector/src/base/safe_conversions.h +0 -389
  262. package/src-native/pods/Headers/inspector/src/base/safe_conversions_impl.h +0 -822
  263. package/src-native/pods/Headers/inspector/src/base/template-utils.h +0 -113
  264. package/src-native/pods/Headers/inspector/src/base/v8-fallthrough.h +0 -21
  265. package/src-native/pods/Headers/inspector/src/common/checks.h +0 -38
  266. package/src-native/pods/Headers/inspector/src/common/globals.h +0 -1842
  267. package/src-native/pods/Headers/inspector/src/debug/debug-interface.h +0 -667
  268. package/src-native/pods/Headers/inspector/src/debug/interface-types.h +0 -175
  269. package/src-native/pods/Headers/inspector/src/init/v8.h +0 -52
  270. package/src-native/pods/Headers/inspector/src/inspector/custom-preview.h +0 -24
  271. package/src-native/pods/Headers/inspector/src/inspector/injected-script.h +0 -251
  272. package/src-native/pods/Headers/inspector/src/inspector/inspected-context.h +0 -79
  273. package/src-native/pods/Headers/inspector/src/inspector/protocol/CSS.h +0 -2148
  274. package/src-native/pods/Headers/inspector/src/inspector/protocol/Console.h +0 -211
  275. package/src-native/pods/Headers/inspector/src/inspector/protocol/DOM.h +0 -1008
  276. package/src-native/pods/Headers/inspector/src/inspector/protocol/Debugger.h +0 -892
  277. package/src-native/pods/Headers/inspector/src/inspector/protocol/Forward.h +0 -75
  278. package/src-native/pods/Headers/inspector/src/inspector/protocol/HeapProfiler.h +0 -346
  279. package/src-native/pods/Headers/inspector/src/inspector/protocol/Log.h +0 -342
  280. package/src-native/pods/Headers/inspector/src/inspector/protocol/Network.h +0 -2528
  281. package/src-native/pods/Headers/inspector/src/inspector/protocol/Overlay.h +0 -281
  282. package/src-native/pods/Headers/inspector/src/inspector/protocol/Page.h +0 -1189
  283. package/src-native/pods/Headers/inspector/src/inspector/protocol/Profiler.h +0 -1001
  284. package/src-native/pods/Headers/inspector/src/inspector/protocol/Protocol.h +0 -617
  285. package/src-native/pods/Headers/inspector/src/inspector/protocol/Runtime.h +0 -1696
  286. package/src-native/pods/Headers/inspector/src/inspector/protocol/Schema.h +0 -146
  287. package/src-native/pods/Headers/inspector/src/inspector/protocol/Security.h +0 -793
  288. package/src-native/pods/Headers/inspector/src/inspector/remote-object-id.h +0 -54
  289. package/src-native/pods/Headers/inspector/src/inspector/search-util.h +0 -26
  290. package/src-native/pods/Headers/inspector/src/inspector/string-16.h +0 -180
  291. package/src-native/pods/Headers/inspector/src/inspector/string-util.h +0 -128
  292. package/src-native/pods/Headers/inspector/src/inspector/v8-console-agent-impl.h +0 -48
  293. package/src-native/pods/Headers/inspector/src/inspector/v8-console-message.h +0 -147
  294. package/src-native/pods/Headers/inspector/src/inspector/v8-console.h +0 -173
  295. package/src-native/pods/Headers/inspector/src/inspector/v8-css-agent-impl.h +0 -62
  296. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-agent-impl.h +0 -248
  297. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-id.h +0 -44
  298. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger-script.h +0 -123
  299. package/src-native/pods/Headers/inspector/src/inspector/v8-debugger.h +0 -257
  300. package/src-native/pods/Headers/inspector/src/inspector/v8-dom-agent-impl.h +0 -91
  301. package/src-native/pods/Headers/inspector/src/inspector/v8-heap-profiler-agent-impl.h +0 -80
  302. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-impl.h +0 -191
  303. package/src-native/pods/Headers/inspector/src/inspector/v8-inspector-session-impl.h +0 -156
  304. package/src-native/pods/Headers/inspector/src/inspector/v8-log-agent-impl.h +0 -34
  305. package/src-native/pods/Headers/inspector/src/inspector/v8-network-agent-impl.h +0 -71
  306. package/src-native/pods/Headers/inspector/src/inspector/v8-ns-debugger-agent-impl.h +0 -24
  307. package/src-native/pods/Headers/inspector/src/inspector/v8-overlay-agent-impl.h +0 -70
  308. package/src-native/pods/Headers/inspector/src/inspector/v8-page-agent-impl.h +0 -88
  309. package/src-native/pods/Headers/inspector/src/inspector/v8-profiler-agent-impl.h +0 -104
  310. package/src-native/pods/Headers/inspector/src/inspector/v8-regex.h +0 -38
  311. package/src-native/pods/Headers/inspector/src/inspector/v8-runtime-agent-impl.h +0 -157
  312. package/src-native/pods/Headers/inspector/src/inspector/v8-schema-agent-impl.h +0 -38
  313. package/src-native/pods/Headers/inspector/src/inspector/v8-stack-trace-impl.h +0 -164
  314. package/src-native/pods/Headers/inspector/src/inspector/v8-string-conversions.h +0 -17
  315. package/src-native/pods/Headers/inspector/src/inspector/v8-value-utils.h +0 -23
  316. package/src-native/pods/Headers/inspector/src/inspector/value-mirror.h +0 -87
  317. package/src-native/pods/Headers/inspector/src/libplatform/default-platform.h +0 -92
  318. package/src-native/pods/Headers/inspector/src/logging/tracing-flags.h +0 -50
  319. package/src-native/pods/Headers/inspector/src/numbers/conversions.h +0 -183
  320. package/src-native/pods/Headers/inspector/src/tracing/trace-event.h +0 -664
  321. package/src-native/pods/Headers/inspector/src/utils/allocation.h +0 -367
  322. package/src-native/pods/Headers/inspector/src/utils/vector.h +0 -324
  323. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/cbor.h +0 -305
  324. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/dispatch.h +0 -314
  325. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/error_support.h +0 -62
  326. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/export.h +0 -6
  327. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/find_by_first.h +0 -58
  328. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/frontend_channel.h +0 -47
  329. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/glue.h +0 -80
  330. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json.h +0 -52
  331. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/json_platform.h +0 -26
  332. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/maybe.h +0 -104
  333. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/parser_handler.h +0 -39
  334. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/protocol_core.h +0 -406
  335. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializable.h +0 -32
  336. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/serializer_traits.h +0 -158
  337. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/span.h +0 -99
  338. package/src-native/pods/Headers/inspector/third_party/inspector_protocol/crdtp/status.h +0 -139
  339. package/src-native/pods/Headers/inspector/utils.h +0 -32
  340. package/src-native/pods/Headers/inspector/v8-inspector-platform.h +0 -44
  341. package/src-native/pods/Headers/jsi/decorator.h +0 -762
  342. package/src-native/pods/Headers/jsi/instrumentation.h +0 -117
  343. package/src-native/pods/Headers/jsi/jsi-inl.h +0 -322
  344. package/src-native/pods/Headers/jsi/jsi.h +0 -1387
  345. package/src-native/pods/Headers/jsi/jsilib.h +0 -59
  346. package/src-native/pods/Headers/jsi/threadsafe.h +0 -79
  347. package/src-native/pods/Headers/runtime/ArgConverter.h +0 -61
  348. package/src-native/pods/Headers/runtime/ArrayAdapter.h +0 -13
  349. package/src-native/pods/Headers/runtime/Caches.h +0 -98
  350. package/src-native/pods/Headers/runtime/ClassBuilder.h +0 -61
  351. package/src-native/pods/Headers/runtime/Common.h +0 -9
  352. package/src-native/pods/Headers/runtime/ConcurrentMap.h +0 -55
  353. package/src-native/pods/Headers/runtime/ConcurrentQueue.h +0 -28
  354. package/src-native/pods/Headers/runtime/Console.h +0 -27
  355. package/src-native/pods/Headers/runtime/Constants.h +0 -15
  356. package/src-native/pods/Headers/runtime/DataWrapper.h +0 -671
  357. package/src-native/pods/Headers/runtime/DictionaryAdapter.h +0 -13
  358. package/src-native/pods/Headers/runtime/ExtVector.h +0 -21
  359. package/src-native/pods/Headers/runtime/FFICall.h +0 -105
  360. package/src-native/pods/Headers/runtime/FastEnumerationAdapter.h +0 -13
  361. package/src-native/pods/Headers/runtime/FunctionReference.h +0 -18
  362. package/src-native/pods/Headers/runtime/Helpers.h +0 -84
  363. package/src-native/pods/Headers/runtime/InlineFunctions.h +0 -16
  364. package/src-native/pods/Headers/runtime/Interop.h +0 -202
  365. package/src-native/pods/Headers/runtime/KnownUnknownClassPair.h +0 -35
  366. package/src-native/pods/Headers/runtime/Metadata.h +0 -981
  367. package/src-native/pods/Headers/runtime/MetadataBuilder.h +0 -72
  368. package/src-native/pods/Headers/runtime/MetadataInlines.h +0 -157
  369. package/src-native/pods/Headers/runtime/ModuleInternal.h +0 -59
  370. package/src-native/pods/Headers/runtime/NSDataAdapter.h +0 -13
  371. package/src-native/pods/Headers/runtime/NativeScriptException.h +0 -27
  372. package/src-native/pods/Headers/runtime/ObjectManager.h +0 -31
  373. package/src-native/pods/Headers/runtime/OneByteStringResource.h +0 -21
  374. package/src-native/pods/Headers/runtime/Pointer.h +0 -26
  375. package/src-native/pods/Headers/runtime/PromiseProxy.h +0 -15
  376. package/src-native/pods/Headers/runtime/Reference.h +0 -38
  377. package/src-native/pods/Headers/runtime/Runtime.h +0 -67
  378. package/src-native/pods/Headers/runtime/RuntimeConfig.h +0 -17
  379. package/src-native/pods/Headers/runtime/SetTimeout.h +0 -34
  380. package/src-native/pods/Headers/runtime/SimpleAllocator.h +0 -23
  381. package/src-native/pods/Headers/runtime/StringHasher.h +0 -315
  382. package/src-native/pods/Headers/runtime/SymbolIterator.h +0 -18
  383. package/src-native/pods/Headers/runtime/SymbolLoader.h +0 -27
  384. package/src-native/pods/Headers/runtime/TNSDerivedClass.h +0 -8
  385. package/src-native/pods/Headers/runtime/TSHelpers.h +0 -15
  386. package/src-native/pods/Headers/runtime/Tasks.h +0 -19
  387. package/src-native/pods/Headers/runtime/UnmanagedType.h +0 -21
  388. package/src-native/pods/Headers/runtime/WeakRef.h +0 -15
  389. package/src-native/pods/Headers/runtime/Worker.h +0 -26
  390. package/src-native/pods/Headers/runtime/robin_hood.h +0 -2184
  391. package/src-native/pods/Headers/v8runtime/HostProxy.h +0 -71
  392. package/src-native/pods/Headers/v8runtime/JSIV8ValueConverter.h +0 -70
  393. package/src-native/pods/Headers/v8runtime/V8PointerValue.h +0 -44
  394. package/src-native/pods/Headers/v8runtime/V8Runtime.h +0 -215
  395. package/src-native/pods/Headers/v8runtime/V8RuntimeConfig.h +0 -26
  396. package/src-native/pods/Headers/v8runtime/V8RuntimeFactory.h +0 -21
  397. package/src-native/pods/NativeScript.podspec +0 -68
@@ -1,939 +0,0 @@
1
- // Copyright 2020 the V8 project authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- /**
6
- * This file provides additional API on top of the default one for making
7
- * API calls, which come from embedder C++ functions. The functions are being
8
- * called directly from optimized code, doing all the necessary typechecks
9
- * in the compiler itself, instead of on the embedder side. Hence the "fast"
10
- * in the name. Example usage might look like:
11
- *
12
- * \code
13
- * void FastMethod(int param, bool another_param);
14
- *
15
- * v8::FunctionTemplate::New(isolate, SlowCallback, data,
16
- * signature, length, constructor_behavior
17
- * side_effect_type,
18
- * &v8::CFunction::Make(FastMethod));
19
- * \endcode
20
- *
21
- * By design, fast calls are limited by the following requirements, which
22
- * the embedder should enforce themselves:
23
- * - they should not allocate on the JS heap;
24
- * - they should not trigger JS execution.
25
- * To enforce them, the embedder could use the existing
26
- * v8::Isolate::DisallowJavascriptExecutionScope and a utility similar to
27
- * Blink's NoAllocationScope:
28
- * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/heap/thread_state_scopes.h;l=16
29
- *
30
- * Due to these limitations, it's not directly possible to report errors by
31
- * throwing a JS exception or to otherwise do an allocation. There is an
32
- * alternative way of creating fast calls that supports falling back to the
33
- * slow call and then performing the necessary allocation. When one creates
34
- * the fast method by using CFunction::MakeWithFallbackSupport instead of
35
- * CFunction::Make, the fast callback gets as last parameter an output variable,
36
- * through which it can request falling back to the slow call. So one might
37
- * declare their method like:
38
- *
39
- * \code
40
- * void FastMethodWithFallback(int param, FastApiCallbackOptions& options);
41
- * \endcode
42
- *
43
- * If the callback wants to signal an error condition or to perform an
44
- * allocation, it must set options.fallback to true and do an early return from
45
- * the fast method. Then V8 checks the value of options.fallback and if it's
46
- * true, falls back to executing the SlowCallback, which is capable of reporting
47
- * the error (either by throwing a JS exception or logging to the console) or
48
- * doing the allocation. It's the embedder's responsibility to ensure that the
49
- * fast callback is idempotent up to the point where error and fallback
50
- * conditions are checked, because otherwise executing the slow callback might
51
- * produce visible side-effects twice.
52
- *
53
- * An example for custom embedder type support might employ a way to wrap/
54
- * unwrap various C++ types in JSObject instances, e.g:
55
- *
56
- * \code
57
- *
58
- * // Helper method with a check for field count.
59
- * template <typename T, int offset>
60
- * inline T* GetInternalField(v8::Local<v8::Object> wrapper) {
61
- * assert(offset < wrapper->InternalFieldCount());
62
- * return reinterpret_cast<T*>(
63
- * wrapper->GetAlignedPointerFromInternalField(offset));
64
- * }
65
- *
66
- * class CustomEmbedderType {
67
- * public:
68
- * // Returns the raw C object from a wrapper JS object.
69
- * static CustomEmbedderType* Unwrap(v8::Local<v8::Object> wrapper) {
70
- * return GetInternalField<CustomEmbedderType,
71
- * kV8EmbedderWrapperObjectIndex>(wrapper);
72
- * }
73
- * static void FastMethod(v8::Local<v8::Object> receiver_obj, int param) {
74
- * CustomEmbedderType* receiver = static_cast<CustomEmbedderType*>(
75
- * receiver_obj->GetAlignedPointerFromInternalField(
76
- * kV8EmbedderWrapperObjectIndex));
77
- *
78
- * // Type checks are already done by the optimized code.
79
- * // Then call some performance-critical method like:
80
- * // receiver->Method(param);
81
- * }
82
- *
83
- * static void SlowMethod(
84
- * const v8::FunctionCallbackInfo<v8::Value>& info) {
85
- * v8::Local<v8::Object> instance =
86
- * v8::Local<v8::Object>::Cast(info.Holder());
87
- * CustomEmbedderType* receiver = Unwrap(instance);
88
- * // TODO: Do type checks and extract {param}.
89
- * receiver->Method(param);
90
- * }
91
- * };
92
- *
93
- * // TODO(mslekova): Clean-up these constants
94
- * // The constants kV8EmbedderWrapperTypeIndex and
95
- * // kV8EmbedderWrapperObjectIndex describe the offsets for the type info
96
- * // struct and the native object, when expressed as internal field indices
97
- * // within a JSObject. The existance of this helper function assumes that
98
- * // all embedder objects have their JSObject-side type info at the same
99
- * // offset, but this is not a limitation of the API itself. For a detailed
100
- * // use case, see the third example.
101
- * static constexpr int kV8EmbedderWrapperTypeIndex = 0;
102
- * static constexpr int kV8EmbedderWrapperObjectIndex = 1;
103
- *
104
- * // The following setup function can be templatized based on
105
- * // the {embedder_object} argument.
106
- * void SetupCustomEmbedderObject(v8::Isolate* isolate,
107
- * v8::Local<v8::Context> context,
108
- * CustomEmbedderType* embedder_object) {
109
- * isolate->set_embedder_wrapper_type_index(
110
- * kV8EmbedderWrapperTypeIndex);
111
- * isolate->set_embedder_wrapper_object_index(
112
- * kV8EmbedderWrapperObjectIndex);
113
- *
114
- * v8::CFunction c_func =
115
- * MakeV8CFunction(CustomEmbedderType::FastMethod);
116
- *
117
- * Local<v8::FunctionTemplate> method_template =
118
- * v8::FunctionTemplate::New(
119
- * isolate, CustomEmbedderType::SlowMethod, v8::Local<v8::Value>(),
120
- * v8::Local<v8::Signature>(), 1, v8::ConstructorBehavior::kAllow,
121
- * v8::SideEffectType::kHasSideEffect, &c_func);
122
- *
123
- * v8::Local<v8::ObjectTemplate> object_template =
124
- * v8::ObjectTemplate::New(isolate);
125
- * object_template->SetInternalFieldCount(
126
- * kV8EmbedderWrapperObjectIndex + 1);
127
- * object_template->Set(isolate, "method", method_template);
128
- *
129
- * // Instantiate the wrapper JS object.
130
- * v8::Local<v8::Object> object =
131
- * object_template->NewInstance(context).ToLocalChecked();
132
- * object->SetAlignedPointerInInternalField(
133
- * kV8EmbedderWrapperObjectIndex,
134
- * reinterpret_cast<void*>(embedder_object));
135
- *
136
- * // TODO: Expose {object} where it's necessary.
137
- * }
138
- * \endcode
139
- *
140
- * For instance if {object} is exposed via a global "obj" variable,
141
- * one could write in JS:
142
- * function hot_func() {
143
- * obj.method(42);
144
- * }
145
- * and once {hot_func} gets optimized, CustomEmbedderType::FastMethod
146
- * will be called instead of the slow version, with the following arguments:
147
- * receiver := the {embedder_object} from above
148
- * param := 42
149
- *
150
- * Currently supported return types:
151
- * - void
152
- * - bool
153
- * - int32_t
154
- * - uint32_t
155
- * - float32_t
156
- * - float64_t
157
- * Currently supported argument types:
158
- * - pointer to an embedder type
159
- * - JavaScript array of primitive types
160
- * - bool
161
- * - int32_t
162
- * - uint32_t
163
- * - int64_t
164
- * - uint64_t
165
- * - float32_t
166
- * - float64_t
167
- *
168
- * The 64-bit integer types currently have the IDL (unsigned) long long
169
- * semantics: https://heycam.github.io/webidl/#abstract-opdef-converttoint
170
- * In the future we'll extend the API to also provide conversions from/to
171
- * BigInt to preserve full precision.
172
- * The floating point types currently have the IDL (unrestricted) semantics,
173
- * which is the only one used by WebGL. We plan to add support also for
174
- * restricted floats/doubles, similarly to the BigInt conversion policies.
175
- * We also differ from the specific NaN bit pattern that WebIDL prescribes
176
- * (https://heycam.github.io/webidl/#es-unrestricted-float) in that Blink
177
- * passes NaN values as-is, i.e. doesn't normalize them.
178
- *
179
- * To be supported types:
180
- * - TypedArrays and ArrayBuffers
181
- * - arrays of embedder types
182
- *
183
- *
184
- * The API offers a limited support for function overloads:
185
- *
186
- * \code
187
- * void FastMethod_2Args(int param, bool another_param);
188
- * void FastMethod_3Args(int param, bool another_param, int third_param);
189
- *
190
- * v8::CFunction fast_method_2args_c_func =
191
- * MakeV8CFunction(FastMethod_2Args);
192
- * v8::CFunction fast_method_3args_c_func =
193
- * MakeV8CFunction(FastMethod_3Args);
194
- * const v8::CFunction fast_method_overloads[] = {fast_method_2args_c_func,
195
- * fast_method_3args_c_func};
196
- * Local<v8::FunctionTemplate> method_template =
197
- * v8::FunctionTemplate::NewWithCFunctionOverloads(
198
- * isolate, SlowCallback, data, signature, length,
199
- * constructor_behavior, side_effect_type,
200
- * {fast_method_overloads, 2});
201
- * \endcode
202
- *
203
- * In this example a single FunctionTemplate is associated to multiple C++
204
- * functions. The overload resolution is currently only based on the number of
205
- * arguments passed in a call. For example, if this method_template is
206
- * registered with a wrapper JS object as described above, a call with two
207
- * arguments:
208
- * obj.method(42, true);
209
- * will result in a fast call to FastMethod_2Args, while a call with three or
210
- * more arguments:
211
- * obj.method(42, true, 11);
212
- * will result in a fast call to FastMethod_3Args. Instead a call with less than
213
- * two arguments, like:
214
- * obj.method(42);
215
- * would not result in a fast call but would fall back to executing the
216
- * associated SlowCallback.
217
- */
218
-
219
- #ifndef INCLUDE_V8_FAST_API_CALLS_H_
220
- #define INCLUDE_V8_FAST_API_CALLS_H_
221
-
222
- #include <stddef.h>
223
- #include <stdint.h>
224
-
225
- #include <tuple>
226
- #include <type_traits>
227
-
228
- #include "v8-internal.h" // NOLINT(build/include_directory)
229
- #include "v8-local-handle.h" // NOLINT(build/include_directory)
230
- #include "v8-typed-array.h" // NOLINT(build/include_directory)
231
- #include "v8-value.h" // NOLINT(build/include_directory)
232
- #include "v8config.h" // NOLINT(build/include_directory)
233
-
234
- namespace v8 {
235
-
236
- class Isolate;
237
-
238
- class CTypeInfo {
239
- public:
240
- enum class Type : uint8_t {
241
- kVoid,
242
- kBool,
243
- kInt32,
244
- kUint32,
245
- kInt64,
246
- kUint64,
247
- kFloat32,
248
- kFloat64,
249
- kV8Value,
250
- kApiObject, // This will be deprecated once all users have
251
- // migrated from v8::ApiObject to v8::Local<v8::Value>.
252
- kAny, // This is added to enable untyped representation of fast
253
- // call arguments for test purposes. It can represent any of
254
- // the other types stored in the same memory as a union (see
255
- // the AnyCType struct declared below). This allows for
256
- // uniform passing of arguments w.r.t. their location
257
- // (in a register or on the stack), independent of their
258
- // actual type. It's currently used by the arm64 simulator
259
- // and can be added to the other simulators as well when fast
260
- // calls having both GP and FP params need to be supported.
261
- };
262
-
263
- // kCallbackOptionsType is not part of the Type enum
264
- // because it is only used internally. Use value 255 that is larger
265
- // than any valid Type enum.
266
- static constexpr Type kCallbackOptionsType = Type(255);
267
-
268
- enum class SequenceType : uint8_t {
269
- kScalar,
270
- kIsSequence, // sequence<T>
271
- kIsTypedArray, // TypedArray of T or any ArrayBufferView if T
272
- // is void
273
- kIsArrayBuffer // ArrayBuffer
274
- };
275
-
276
- enum class Flags : uint8_t {
277
- kNone = 0,
278
- kAllowSharedBit = 1 << 0, // Must be an ArrayBuffer or TypedArray
279
- kEnforceRangeBit = 1 << 1, // T must be integral
280
- kClampBit = 1 << 2, // T must be integral
281
- kIsRestrictedBit = 1 << 3, // T must be float or double
282
- };
283
-
284
- explicit constexpr CTypeInfo(
285
- Type type, SequenceType sequence_type = SequenceType::kScalar,
286
- Flags flags = Flags::kNone)
287
- : type_(type), sequence_type_(sequence_type), flags_(flags) {}
288
-
289
- typedef uint32_t Identifier;
290
- explicit constexpr CTypeInfo(Identifier identifier)
291
- : CTypeInfo(static_cast<Type>(identifier >> 16),
292
- static_cast<SequenceType>((identifier >> 8) & 255),
293
- static_cast<Flags>(identifier & 255)) {}
294
- constexpr Identifier GetId() const {
295
- return static_cast<uint8_t>(type_) << 16 |
296
- static_cast<uint8_t>(sequence_type_) << 8 |
297
- static_cast<uint8_t>(flags_);
298
- }
299
-
300
- constexpr Type GetType() const { return type_; }
301
- constexpr SequenceType GetSequenceType() const { return sequence_type_; }
302
- constexpr Flags GetFlags() const { return flags_; }
303
-
304
- static constexpr bool IsIntegralType(Type type) {
305
- return type == Type::kInt32 || type == Type::kUint32 ||
306
- type == Type::kInt64 || type == Type::kUint64;
307
- }
308
-
309
- static constexpr bool IsFloatingPointType(Type type) {
310
- return type == Type::kFloat32 || type == Type::kFloat64;
311
- }
312
-
313
- static constexpr bool IsPrimitive(Type type) {
314
- return IsIntegralType(type) || IsFloatingPointType(type) ||
315
- type == Type::kBool;
316
- }
317
-
318
- private:
319
- Type type_;
320
- SequenceType sequence_type_;
321
- Flags flags_;
322
- };
323
-
324
- struct FastApiTypedArrayBase {
325
- public:
326
- // Returns the length in number of elements.
327
- size_t V8_EXPORT length() const { return length_; }
328
- // Checks whether the given index is within the bounds of the collection.
329
- void V8_EXPORT ValidateIndex(size_t index) const;
330
-
331
- protected:
332
- size_t length_ = 0;
333
- };
334
-
335
- template <typename T>
336
- struct FastApiTypedArray : public FastApiTypedArrayBase {
337
- public:
338
- V8_INLINE T get(size_t index) const {
339
- #ifdef DEBUG
340
- ValidateIndex(index);
341
- #endif // DEBUG
342
- T tmp;
343
- memcpy(&tmp, reinterpret_cast<T*>(data_) + index, sizeof(T));
344
- return tmp;
345
- }
346
-
347
- bool getStorageIfAligned(T** elements) const {
348
- if (reinterpret_cast<uintptr_t>(data_) % alignof(T) != 0) {
349
- return false;
350
- }
351
- *elements = reinterpret_cast<T*>(data_);
352
- return true;
353
- }
354
-
355
- private:
356
- // This pointer should include the typed array offset applied.
357
- // It's not guaranteed that it's aligned to sizeof(T), it's only
358
- // guaranteed that it's 4-byte aligned, so for 8-byte types we need to
359
- // provide a special implementation for reading from it, which hides
360
- // the possibly unaligned read in the `get` method.
361
- void* data_;
362
- };
363
-
364
- // Any TypedArray. It uses kTypedArrayBit with base type void
365
- // Overloaded args of ArrayBufferView and TypedArray are not supported
366
- // (for now) because the generic “any” ArrayBufferView doesn’t have its
367
- // own instance type. It could be supported if we specify that
368
- // TypedArray<T> always has precedence over the generic ArrayBufferView,
369
- // but this complicates overload resolution.
370
- struct FastApiArrayBufferView {
371
- void* data;
372
- size_t byte_length;
373
- };
374
-
375
- struct FastApiArrayBuffer {
376
- void* data;
377
- size_t byte_length;
378
- };
379
-
380
- class V8_EXPORT CFunctionInfo {
381
- public:
382
- // Construct a struct to hold a CFunction's type information.
383
- // |return_info| describes the function's return type.
384
- // |arg_info| is an array of |arg_count| CTypeInfos describing the
385
- // arguments. Only the last argument may be of the special type
386
- // CTypeInfo::kCallbackOptionsType.
387
- CFunctionInfo(const CTypeInfo& return_info, unsigned int arg_count,
388
- const CTypeInfo* arg_info);
389
-
390
- const CTypeInfo& ReturnInfo() const { return return_info_; }
391
-
392
- // The argument count, not including the v8::FastApiCallbackOptions
393
- // if present.
394
- unsigned int ArgumentCount() const {
395
- return HasOptions() ? arg_count_ - 1 : arg_count_;
396
- }
397
-
398
- // |index| must be less than ArgumentCount().
399
- // Note: if the last argument passed on construction of CFunctionInfo
400
- // has type CTypeInfo::kCallbackOptionsType, it is not included in
401
- // ArgumentCount().
402
- const CTypeInfo& ArgumentInfo(unsigned int index) const;
403
-
404
- bool HasOptions() const {
405
- // The options arg is always the last one.
406
- return arg_count_ > 0 && arg_info_[arg_count_ - 1].GetType() ==
407
- CTypeInfo::kCallbackOptionsType;
408
- }
409
-
410
- private:
411
- const CTypeInfo return_info_;
412
- const unsigned int arg_count_;
413
- const CTypeInfo* arg_info_;
414
- };
415
-
416
- struct FastApiCallbackOptions;
417
-
418
- // Provided for testing.
419
- struct AnyCType {
420
- AnyCType() : int64_value(0) {}
421
-
422
- union {
423
- bool bool_value;
424
- int32_t int32_value;
425
- uint32_t uint32_value;
426
- int64_t int64_value;
427
- uint64_t uint64_value;
428
- float float_value;
429
- double double_value;
430
- Local<Object> object_value;
431
- Local<Array> sequence_value;
432
- const FastApiTypedArray<int32_t>* int32_ta_value;
433
- const FastApiTypedArray<uint32_t>* uint32_ta_value;
434
- const FastApiTypedArray<int64_t>* int64_ta_value;
435
- const FastApiTypedArray<uint64_t>* uint64_ta_value;
436
- const FastApiTypedArray<float>* float_ta_value;
437
- const FastApiTypedArray<double>* double_ta_value;
438
- FastApiCallbackOptions* options_value;
439
- };
440
- };
441
-
442
- static_assert(
443
- sizeof(AnyCType) == 8,
444
- "The AnyCType struct should have size == 64 bits, as this is assumed "
445
- "by EffectControlLinearizer.");
446
-
447
- class V8_EXPORT CFunction {
448
- public:
449
- constexpr CFunction() : address_(nullptr), type_info_(nullptr) {}
450
-
451
- const CTypeInfo& ReturnInfo() const { return type_info_->ReturnInfo(); }
452
-
453
- const CTypeInfo& ArgumentInfo(unsigned int index) const {
454
- return type_info_->ArgumentInfo(index);
455
- }
456
-
457
- unsigned int ArgumentCount() const { return type_info_->ArgumentCount(); }
458
-
459
- const void* GetAddress() const { return address_; }
460
- const CFunctionInfo* GetTypeInfo() const { return type_info_; }
461
-
462
- enum class OverloadResolution { kImpossible, kAtRuntime, kAtCompileTime };
463
-
464
- // Returns whether an overload between this and the given CFunction can
465
- // be resolved at runtime by the RTTI available for the arguments or at
466
- // compile time for functions with different number of arguments.
467
- OverloadResolution GetOverloadResolution(const CFunction* other) {
468
- // Runtime overload resolution can only deal with functions with the
469
- // same number of arguments. Functions with different arity are handled
470
- // by compile time overload resolution though.
471
- if (ArgumentCount() != other->ArgumentCount()) {
472
- return OverloadResolution::kAtCompileTime;
473
- }
474
-
475
- // The functions can only differ by a single argument position.
476
- int diff_index = -1;
477
- for (unsigned int i = 0; i < ArgumentCount(); ++i) {
478
- if (ArgumentInfo(i).GetSequenceType() !=
479
- other->ArgumentInfo(i).GetSequenceType()) {
480
- if (diff_index >= 0) {
481
- return OverloadResolution::kImpossible;
482
- }
483
- diff_index = i;
484
-
485
- // We only support overload resolution between sequence types.
486
- if (ArgumentInfo(i).GetSequenceType() ==
487
- CTypeInfo::SequenceType::kScalar ||
488
- other->ArgumentInfo(i).GetSequenceType() ==
489
- CTypeInfo::SequenceType::kScalar) {
490
- return OverloadResolution::kImpossible;
491
- }
492
- }
493
- }
494
-
495
- return OverloadResolution::kAtRuntime;
496
- }
497
-
498
- template <typename F>
499
- static CFunction Make(F* func) {
500
- return ArgUnwrap<F*>::Make(func);
501
- }
502
-
503
- // Provided for testing purposes.
504
- template <typename R, typename... Args, typename R_Patch,
505
- typename... Args_Patch>
506
- static CFunction Make(R (*func)(Args...),
507
- R_Patch (*patching_func)(Args_Patch...)) {
508
- CFunction c_func = ArgUnwrap<R (*)(Args...)>::Make(func);
509
- static_assert(
510
- sizeof...(Args_Patch) == sizeof...(Args),
511
- "The patching function must have the same number of arguments.");
512
- c_func.address_ = reinterpret_cast<void*>(patching_func);
513
- return c_func;
514
- }
515
-
516
- CFunction(const void* address, const CFunctionInfo* type_info);
517
-
518
- private:
519
- const void* address_;
520
- const CFunctionInfo* type_info_;
521
-
522
- template <typename F>
523
- class ArgUnwrap {
524
- static_assert(sizeof(F) != sizeof(F),
525
- "CFunction must be created from a function pointer.");
526
- };
527
-
528
- template <typename R, typename... Args>
529
- class ArgUnwrap<R (*)(Args...)> {
530
- public:
531
- static CFunction Make(R (*func)(Args...));
532
- };
533
- };
534
-
535
- /**
536
- * A struct which may be passed to a fast call callback, like so:
537
- * \code
538
- * void FastMethodWithOptions(int param, FastApiCallbackOptions& options);
539
- * \endcode
540
- */
541
- struct FastApiCallbackOptions {
542
- /**
543
- * Creates a new instance of FastApiCallbackOptions for testing purpose. The
544
- * returned instance may be filled with mock data.
545
- */
546
- static FastApiCallbackOptions CreateForTesting(Isolate* isolate) {
547
- return {false, {0}};
548
- }
549
-
550
- /**
551
- * If the callback wants to signal an error condition or to perform an
552
- * allocation, it must set options.fallback to true and do an early return
553
- * from the fast method. Then V8 checks the value of options.fallback and if
554
- * it's true, falls back to executing the SlowCallback, which is capable of
555
- * reporting the error (either by throwing a JS exception or logging to the
556
- * console) or doing the allocation. It's the embedder's responsibility to
557
- * ensure that the fast callback is idempotent up to the point where error and
558
- * fallback conditions are checked, because otherwise executing the slow
559
- * callback might produce visible side-effects twice.
560
- */
561
- bool fallback;
562
-
563
- /**
564
- * The `data` passed to the FunctionTemplate constructor, or `undefined`.
565
- * `data_ptr` allows for default constructing FastApiCallbackOptions.
566
- */
567
- union {
568
- uintptr_t data_ptr;
569
- v8::Value data;
570
- };
571
- };
572
-
573
- namespace internal {
574
-
575
- // Helper to count the number of occurances of `T` in `List`
576
- template <typename T, typename... List>
577
- struct count : std::integral_constant<int, 0> {};
578
- template <typename T, typename... Args>
579
- struct count<T, T, Args...>
580
- : std::integral_constant<std::size_t, 1 + count<T, Args...>::value> {};
581
- template <typename T, typename U, typename... Args>
582
- struct count<T, U, Args...> : count<T, Args...> {};
583
-
584
- template <typename RetBuilder, typename... ArgBuilders>
585
- class CFunctionInfoImpl : public CFunctionInfo {
586
- static constexpr int kOptionsArgCount =
587
- count<FastApiCallbackOptions&, ArgBuilders...>();
588
- static constexpr int kReceiverCount = 1;
589
-
590
- static_assert(kOptionsArgCount == 0 || kOptionsArgCount == 1,
591
- "Only one options parameter is supported.");
592
-
593
- static_assert(sizeof...(ArgBuilders) >= kOptionsArgCount + kReceiverCount,
594
- "The receiver or the options argument is missing.");
595
-
596
- public:
597
- constexpr CFunctionInfoImpl()
598
- : CFunctionInfo(RetBuilder::Build(), sizeof...(ArgBuilders),
599
- arg_info_storage_),
600
- arg_info_storage_{ArgBuilders::Build()...} {
601
- constexpr CTypeInfo::Type kReturnType = RetBuilder::Build().GetType();
602
- static_assert(kReturnType == CTypeInfo::Type::kVoid ||
603
- kReturnType == CTypeInfo::Type::kBool ||
604
- kReturnType == CTypeInfo::Type::kInt32 ||
605
- kReturnType == CTypeInfo::Type::kUint32 ||
606
- kReturnType == CTypeInfo::Type::kFloat32 ||
607
- kReturnType == CTypeInfo::Type::kFloat64 ||
608
- kReturnType == CTypeInfo::Type::kAny,
609
- "64-bit int and api object values are not currently "
610
- "supported return types.");
611
- }
612
-
613
- private:
614
- const CTypeInfo arg_info_storage_[sizeof...(ArgBuilders)];
615
- };
616
-
617
- template <typename T>
618
- struct TypeInfoHelper {
619
- static_assert(sizeof(T) != sizeof(T), "This type is not supported");
620
- };
621
-
622
- #define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR(T, Enum) \
623
- template <> \
624
- struct TypeInfoHelper<T> { \
625
- static constexpr CTypeInfo::Flags Flags() { \
626
- return CTypeInfo::Flags::kNone; \
627
- } \
628
- \
629
- static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \
630
- static constexpr CTypeInfo::SequenceType SequenceType() { \
631
- return CTypeInfo::SequenceType::kScalar; \
632
- } \
633
- };
634
-
635
- template <CTypeInfo::Type type>
636
- struct CTypeInfoTraits {};
637
-
638
- #define DEFINE_TYPE_INFO_TRAITS(CType, Enum) \
639
- template <> \
640
- struct CTypeInfoTraits<CTypeInfo::Type::Enum> { \
641
- using ctype = CType; \
642
- };
643
-
644
- #define PRIMITIVE_C_TYPES(V) \
645
- V(bool, kBool) \
646
- V(int32_t, kInt32) \
647
- V(uint32_t, kUint32) \
648
- V(int64_t, kInt64) \
649
- V(uint64_t, kUint64) \
650
- V(float, kFloat32) \
651
- V(double, kFloat64)
652
-
653
- // Same as above, but includes deprecated types for compatibility.
654
- #define ALL_C_TYPES(V) \
655
- PRIMITIVE_C_TYPES(V) \
656
- V(void, kVoid) \
657
- V(v8::Local<v8::Value>, kV8Value) \
658
- V(v8::Local<v8::Object>, kV8Value) \
659
- V(AnyCType, kAny)
660
-
661
- // ApiObject was a temporary solution to wrap the pointer to the v8::Value.
662
- // Please use v8::Local<v8::Value> in new code for the arguments and
663
- // v8::Local<v8::Object> for the receiver, as ApiObject will be deprecated.
664
-
665
- ALL_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR)
666
- PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
667
-
668
- #undef PRIMITIVE_C_TYPES
669
- #undef ALL_C_TYPES
670
-
671
- #define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \
672
- template <> \
673
- struct TypeInfoHelper<const FastApiTypedArray<T>&> { \
674
- static constexpr CTypeInfo::Flags Flags() { \
675
- return CTypeInfo::Flags::kNone; \
676
- } \
677
- \
678
- static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \
679
- static constexpr CTypeInfo::SequenceType SequenceType() { \
680
- return CTypeInfo::SequenceType::kIsTypedArray; \
681
- } \
682
- };
683
-
684
- #define TYPED_ARRAY_C_TYPES(V) \
685
- V(int32_t, kInt32) \
686
- V(uint32_t, kUint32) \
687
- V(int64_t, kInt64) \
688
- V(uint64_t, kUint64) \
689
- V(float, kFloat32) \
690
- V(double, kFloat64)
691
-
692
- TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA)
693
-
694
- #undef TYPED_ARRAY_C_TYPES
695
-
696
- template <>
697
- struct TypeInfoHelper<v8::Local<v8::Array>> {
698
- static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
699
-
700
- static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kVoid; }
701
- static constexpr CTypeInfo::SequenceType SequenceType() {
702
- return CTypeInfo::SequenceType::kIsSequence;
703
- }
704
- };
705
-
706
- template <>
707
- struct TypeInfoHelper<v8::Local<v8::Uint32Array>> {
708
- static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
709
-
710
- static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kUint32; }
711
- static constexpr CTypeInfo::SequenceType SequenceType() {
712
- return CTypeInfo::SequenceType::kIsTypedArray;
713
- }
714
- };
715
-
716
- template <>
717
- struct TypeInfoHelper<FastApiCallbackOptions&> {
718
- static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
719
-
720
- static constexpr CTypeInfo::Type Type() {
721
- return CTypeInfo::kCallbackOptionsType;
722
- }
723
- static constexpr CTypeInfo::SequenceType SequenceType() {
724
- return CTypeInfo::SequenceType::kScalar;
725
- }
726
- };
727
-
728
- #define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \
729
- static_assert(((COND) == 0) || (ASSERTION), MSG)
730
-
731
- } // namespace internal
732
-
733
- template <typename T, CTypeInfo::Flags... Flags>
734
- class V8_EXPORT CTypeInfoBuilder {
735
- public:
736
- using BaseType = T;
737
-
738
- static constexpr CTypeInfo Build() {
739
- constexpr CTypeInfo::Flags kFlags =
740
- MergeFlags(internal::TypeInfoHelper<T>::Flags(), Flags...);
741
- constexpr CTypeInfo::Type kType = internal::TypeInfoHelper<T>::Type();
742
- constexpr CTypeInfo::SequenceType kSequenceType =
743
- internal::TypeInfoHelper<T>::SequenceType();
744
-
745
- STATIC_ASSERT_IMPLIES(
746
- uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit),
747
- (kSequenceType == CTypeInfo::SequenceType::kIsTypedArray ||
748
- kSequenceType == CTypeInfo::SequenceType::kIsArrayBuffer),
749
- "kAllowSharedBit is only allowed for TypedArrays and ArrayBuffers.");
750
- STATIC_ASSERT_IMPLIES(
751
- uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kEnforceRangeBit),
752
- CTypeInfo::IsIntegralType(kType),
753
- "kEnforceRangeBit is only allowed for integral types.");
754
- STATIC_ASSERT_IMPLIES(
755
- uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kClampBit),
756
- CTypeInfo::IsIntegralType(kType),
757
- "kClampBit is only allowed for integral types.");
758
- STATIC_ASSERT_IMPLIES(
759
- uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kIsRestrictedBit),
760
- CTypeInfo::IsFloatingPointType(kType),
761
- "kIsRestrictedBit is only allowed for floating point types.");
762
- STATIC_ASSERT_IMPLIES(kSequenceType == CTypeInfo::SequenceType::kIsSequence,
763
- kType == CTypeInfo::Type::kVoid,
764
- "Sequences are only supported from void type.");
765
- STATIC_ASSERT_IMPLIES(
766
- kSequenceType == CTypeInfo::SequenceType::kIsTypedArray,
767
- CTypeInfo::IsPrimitive(kType) || kType == CTypeInfo::Type::kVoid,
768
- "TypedArrays are only supported from primitive types or void.");
769
-
770
- // Return the same type with the merged flags.
771
- return CTypeInfo(internal::TypeInfoHelper<T>::Type(),
772
- internal::TypeInfoHelper<T>::SequenceType(), kFlags);
773
- }
774
-
775
- private:
776
- template <typename... Rest>
777
- static constexpr CTypeInfo::Flags MergeFlags(CTypeInfo::Flags flags,
778
- Rest... rest) {
779
- return CTypeInfo::Flags(uint8_t(flags) | uint8_t(MergeFlags(rest...)));
780
- }
781
- static constexpr CTypeInfo::Flags MergeFlags() { return CTypeInfo::Flags(0); }
782
- };
783
-
784
- namespace internal {
785
- template <typename RetBuilder, typename... ArgBuilders>
786
- class CFunctionBuilderWithFunction {
787
- public:
788
- explicit constexpr CFunctionBuilderWithFunction(const void* fn) : fn_(fn) {}
789
-
790
- template <CTypeInfo::Flags... Flags>
791
- constexpr auto Ret() {
792
- return CFunctionBuilderWithFunction<
793
- CTypeInfoBuilder<typename RetBuilder::BaseType, Flags...>,
794
- ArgBuilders...>(fn_);
795
- }
796
-
797
- template <unsigned int N, CTypeInfo::Flags... Flags>
798
- constexpr auto Arg() {
799
- // Return a copy of the builder with the Nth arg builder merged with
800
- // template parameter pack Flags.
801
- return ArgImpl<N, Flags...>(
802
- std::make_index_sequence<sizeof...(ArgBuilders)>());
803
- }
804
-
805
- auto Build() {
806
- static CFunctionInfoImpl<RetBuilder, ArgBuilders...> instance;
807
- return CFunction(fn_, &instance);
808
- }
809
-
810
- private:
811
- template <bool Merge, unsigned int N, CTypeInfo::Flags... Flags>
812
- struct GetArgBuilder;
813
-
814
- // Returns the same ArgBuilder as the one at index N, including its flags.
815
- // Flags in the template parameter pack are ignored.
816
- template <unsigned int N, CTypeInfo::Flags... Flags>
817
- struct GetArgBuilder<false, N, Flags...> {
818
- using type =
819
- typename std::tuple_element<N, std::tuple<ArgBuilders...>>::type;
820
- };
821
-
822
- // Returns an ArgBuilder with the same base type as the one at index N,
823
- // but merges the flags with the flags in the template parameter pack.
824
- template <unsigned int N, CTypeInfo::Flags... Flags>
825
- struct GetArgBuilder<true, N, Flags...> {
826
- using type = CTypeInfoBuilder<
827
- typename std::tuple_element<N,
828
- std::tuple<ArgBuilders...>>::type::BaseType,
829
- std::tuple_element<N, std::tuple<ArgBuilders...>>::type::Build()
830
- .GetFlags(),
831
- Flags...>;
832
- };
833
-
834
- // Return a copy of the CFunctionBuilder, but merges the Flags on
835
- // ArgBuilder index N with the new Flags passed in the template parameter
836
- // pack.
837
- template <unsigned int N, CTypeInfo::Flags... Flags, size_t... I>
838
- constexpr auto ArgImpl(std::index_sequence<I...>) {
839
- return CFunctionBuilderWithFunction<
840
- RetBuilder, typename GetArgBuilder<N == I, I, Flags...>::type...>(fn_);
841
- }
842
-
843
- const void* fn_;
844
- };
845
-
846
- class CFunctionBuilder {
847
- public:
848
- constexpr CFunctionBuilder() {}
849
-
850
- template <typename R, typename... Args>
851
- constexpr auto Fn(R (*fn)(Args...)) {
852
- return CFunctionBuilderWithFunction<CTypeInfoBuilder<R>,
853
- CTypeInfoBuilder<Args>...>(
854
- reinterpret_cast<const void*>(fn));
855
- }
856
- };
857
-
858
- } // namespace internal
859
-
860
- // static
861
- template <typename R, typename... Args>
862
- CFunction CFunction::ArgUnwrap<R (*)(Args...)>::Make(R (*func)(Args...)) {
863
- return internal::CFunctionBuilder().Fn(func).Build();
864
- }
865
-
866
- using CFunctionBuilder = internal::CFunctionBuilder;
867
-
868
- static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32);
869
- static constexpr CTypeInfo kTypeInfoFloat64 =
870
- CTypeInfo(CTypeInfo::Type::kFloat64);
871
-
872
- /**
873
- * Copies the contents of this JavaScript array to a C++ buffer with
874
- * a given max_length. A CTypeInfo is passed as an argument,
875
- * instructing different rules for conversion (e.g. restricted float/double).
876
- * The element type T of the destination array must match the C type
877
- * corresponding to the CTypeInfo (specified by CTypeInfoTraits).
878
- * If the array length is larger than max_length or the array is of
879
- * unsupported type, the operation will fail, returning false. Generally, an
880
- * array which contains objects, undefined, null or anything not convertible
881
- * to the requested destination type, is considered unsupported. The operation
882
- * returns true on success. `type_info` will be used for conversions.
883
- */
884
- template <const CTypeInfo* type_info, typename T>
885
- V8_DEPRECATED(
886
- "Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
887
- bool V8_EXPORT V8_WARN_UNUSED_RESULT
888
- TryCopyAndConvertArrayToCppBuffer(Local<Array> src, T* dst,
889
- uint32_t max_length);
890
-
891
- template <>
892
- V8_DEPRECATED(
893
- "Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
894
- inline bool V8_WARN_UNUSED_RESULT
895
- TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>(
896
- Local<Array> src, int32_t* dst, uint32_t max_length) {
897
- return false;
898
- }
899
-
900
- template <>
901
- V8_DEPRECATED(
902
- "Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
903
- inline bool V8_WARN_UNUSED_RESULT
904
- TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>(
905
- Local<Array> src, double* dst, uint32_t max_length) {
906
- return false;
907
- }
908
-
909
- template <CTypeInfo::Identifier type_info_id, typename T>
910
- bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer(
911
- Local<Array> src, T* dst, uint32_t max_length);
912
-
913
- template <>
914
- bool V8_EXPORT V8_WARN_UNUSED_RESULT
915
- TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<int32_t>::Build().GetId(),
916
- int32_t>(Local<Array> src, int32_t* dst,
917
- uint32_t max_length);
918
-
919
- template <>
920
- bool V8_EXPORT V8_WARN_UNUSED_RESULT
921
- TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<uint32_t>::Build().GetId(),
922
- uint32_t>(Local<Array> src, uint32_t* dst,
923
- uint32_t max_length);
924
-
925
- template <>
926
- bool V8_EXPORT V8_WARN_UNUSED_RESULT
927
- TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<float>::Build().GetId(),
928
- float>(Local<Array> src, float* dst,
929
- uint32_t max_length);
930
-
931
- template <>
932
- bool V8_EXPORT V8_WARN_UNUSED_RESULT
933
- TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<double>::Build().GetId(),
934
- double>(Local<Array> src, double* dst,
935
- uint32_t max_length);
936
-
937
- } // namespace v8
938
-
939
- #endif // INCLUDE_V8_FAST_API_CALLS_H_