@triniwiz/nativescript-masonkit 1.0.0-alpha.9 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1137 -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 +52485 -22807
  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 +52485 -22807
  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 +52485 -22807
  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 +112 -53
  66. package/style.js +1199 -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,866 +0,0 @@
1
- // Copyright 2021 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
- #ifndef INCLUDE_V8_PRIMITIVE_H_
6
- #define INCLUDE_V8_PRIMITIVE_H_
7
-
8
- #include "v8-data.h" // NOLINT(build/include_directory)
9
- #include "v8-internal.h" // NOLINT(build/include_directory)
10
- #include "v8-local-handle.h" // NOLINT(build/include_directory)
11
- #include "v8-value.h" // NOLINT(build/include_directory)
12
- #include "v8config.h" // NOLINT(build/include_directory)
13
-
14
- namespace v8 {
15
-
16
- class Context;
17
- class Isolate;
18
- class String;
19
-
20
- namespace internal {
21
- class ExternalString;
22
- class ScopedExternalStringLock;
23
- } // namespace internal
24
-
25
- /**
26
- * The superclass of primitive values. See ECMA-262 4.3.2.
27
- */
28
- class V8_EXPORT Primitive : public Value {};
29
-
30
- /**
31
- * A primitive boolean value (ECMA-262, 4.3.14). Either the true
32
- * or false value.
33
- */
34
- class V8_EXPORT Boolean : public Primitive {
35
- public:
36
- bool Value() const;
37
- V8_INLINE static Boolean* Cast(v8::Data* data) {
38
- #ifdef V8_ENABLE_CHECKS
39
- CheckCast(data);
40
- #endif
41
- return static_cast<Boolean*>(data);
42
- }
43
-
44
- V8_INLINE static Local<Boolean> New(Isolate* isolate, bool value);
45
-
46
- private:
47
- static void CheckCast(v8::Data* that);
48
- };
49
-
50
- /**
51
- * An array to hold Primitive values. This is used by the embedder to
52
- * pass host defined options to the ScriptOptions during compilation.
53
- *
54
- * This is passed back to the embedder as part of
55
- * HostImportModuleDynamicallyCallback for module loading.
56
- */
57
- class V8_EXPORT PrimitiveArray : public Data {
58
- public:
59
- static Local<PrimitiveArray> New(Isolate* isolate, int length);
60
- int Length() const;
61
- void Set(Isolate* isolate, int index, Local<Primitive> item);
62
- Local<Primitive> Get(Isolate* isolate, int index);
63
-
64
- V8_INLINE static PrimitiveArray* Cast(Data* data) {
65
- #ifdef V8_ENABLE_CHECKS
66
- CheckCast(data);
67
- #endif
68
- return reinterpret_cast<PrimitiveArray*>(data);
69
- }
70
-
71
- private:
72
- static void CheckCast(Data* obj);
73
- };
74
-
75
- /**
76
- * A superclass for symbols and strings.
77
- */
78
- class V8_EXPORT Name : public Primitive {
79
- public:
80
- /**
81
- * Returns the identity hash for this object. The current implementation
82
- * uses an inline property on the object to store the identity hash.
83
- *
84
- * The return value will never be 0. Also, it is not guaranteed to be
85
- * unique.
86
- */
87
- int GetIdentityHash();
88
-
89
- V8_INLINE static Name* Cast(Data* data) {
90
- #ifdef V8_ENABLE_CHECKS
91
- CheckCast(data);
92
- #endif
93
- return static_cast<Name*>(data);
94
- }
95
-
96
- private:
97
- static void CheckCast(Data* that);
98
- };
99
-
100
- /**
101
- * A flag describing different modes of string creation.
102
- *
103
- * Aside from performance implications there are no differences between the two
104
- * creation modes.
105
- */
106
- enum class NewStringType {
107
- /**
108
- * Create a new string, always allocating new storage memory.
109
- */
110
- kNormal,
111
-
112
- /**
113
- * Acts as a hint that the string should be created in the
114
- * old generation heap space and be deduplicated if an identical string
115
- * already exists.
116
- */
117
- kInternalized
118
- };
119
-
120
- /**
121
- * A JavaScript string value (ECMA-262, 4.3.17).
122
- */
123
- class V8_EXPORT String : public Name {
124
- public:
125
- static constexpr int kMaxLength =
126
- internal::kApiSystemPointerSize == 4 ? (1 << 28) - 16 : (1 << 29) - 24;
127
-
128
- enum Encoding {
129
- UNKNOWN_ENCODING = 0x1,
130
- TWO_BYTE_ENCODING = 0x0,
131
- ONE_BYTE_ENCODING = 0x8
132
- };
133
- /**
134
- * Returns the number of characters (UTF-16 code units) in this string.
135
- */
136
- int Length() const;
137
-
138
- /**
139
- * Returns the number of bytes in the UTF-8 encoded
140
- * representation of this string.
141
- */
142
- int Utf8Length(Isolate* isolate) const;
143
-
144
- /**
145
- * Returns whether this string is known to contain only one byte data,
146
- * i.e. ISO-8859-1 code points.
147
- * Does not read the string.
148
- * False negatives are possible.
149
- */
150
- bool IsOneByte() const;
151
-
152
- /**
153
- * Returns whether this string contain only one byte data,
154
- * i.e. ISO-8859-1 code points.
155
- * Will read the entire string in some cases.
156
- */
157
- bool ContainsOnlyOneByte() const;
158
-
159
- /**
160
- * Write the contents of the string to an external buffer.
161
- * If no arguments are given, expects the buffer to be large
162
- * enough to hold the entire string and NULL terminator. Copies
163
- * the contents of the string and the NULL terminator into the
164
- * buffer.
165
- *
166
- * WriteUtf8 will not write partial UTF-8 sequences, preferring to stop
167
- * before the end of the buffer.
168
- *
169
- * Copies up to length characters into the output buffer.
170
- * Only null-terminates if there is enough space in the buffer.
171
- *
172
- * \param buffer The buffer into which the string will be copied.
173
- * \param start The starting position within the string at which
174
- * copying begins.
175
- * \param length The number of characters to copy from the string. For
176
- * WriteUtf8 the number of bytes in the buffer.
177
- * \param nchars_ref The number of characters written, can be NULL.
178
- * \param options Various options that might affect performance of this or
179
- * subsequent operations.
180
- * \return The number of characters copied to the buffer excluding the null
181
- * terminator. For WriteUtf8: The number of bytes copied to the buffer
182
- * including the null terminator (if written).
183
- */
184
- enum WriteOptions {
185
- NO_OPTIONS = 0,
186
- HINT_MANY_WRITES_EXPECTED = 1,
187
- NO_NULL_TERMINATION = 2,
188
- PRESERVE_ONE_BYTE_NULL = 4,
189
- // Used by WriteUtf8 to replace orphan surrogate code units with the
190
- // unicode replacement character. Needs to be set to guarantee valid UTF-8
191
- // output.
192
- REPLACE_INVALID_UTF8 = 8
193
- };
194
-
195
- // 16-bit character codes.
196
- int Write(Isolate* isolate, uint16_t* buffer, int start = 0, int length = -1,
197
- int options = NO_OPTIONS) const;
198
- // One byte characters.
199
- int WriteOneByte(Isolate* isolate, uint8_t* buffer, int start = 0,
200
- int length = -1, int options = NO_OPTIONS) const;
201
- // UTF-8 encoded characters.
202
- int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
203
- int* nchars_ref = nullptr, int options = NO_OPTIONS) const;
204
-
205
- /**
206
- * A zero length string.
207
- */
208
- V8_INLINE static Local<String> Empty(Isolate* isolate);
209
-
210
- /**
211
- * Returns true if the string is external.
212
- */
213
- bool IsExternal() const;
214
-
215
- /**
216
- * Returns true if the string is both external and two-byte.
217
- */
218
- bool IsExternalTwoByte() const;
219
-
220
- /**
221
- * Returns true if the string is both external and one-byte.
222
- */
223
- bool IsExternalOneByte() const;
224
-
225
- class V8_EXPORT ExternalStringResourceBase {
226
- public:
227
- virtual ~ExternalStringResourceBase() = default;
228
-
229
- /**
230
- * If a string is cacheable, the value returned by
231
- * ExternalStringResource::data() may be cached, otherwise it is not
232
- * expected to be stable beyond the current top-level task.
233
- */
234
- virtual bool IsCacheable() const { return true; }
235
-
236
- // Disallow copying and assigning.
237
- ExternalStringResourceBase(const ExternalStringResourceBase&) = delete;
238
- void operator=(const ExternalStringResourceBase&) = delete;
239
-
240
- protected:
241
- ExternalStringResourceBase() = default;
242
-
243
- /**
244
- * Internally V8 will call this Dispose method when the external string
245
- * resource is no longer needed. The default implementation will use the
246
- * delete operator. This method can be overridden in subclasses to
247
- * control how allocated external string resources are disposed.
248
- */
249
- virtual void Dispose() { delete this; }
250
-
251
- /**
252
- * For a non-cacheable string, the value returned by
253
- * |ExternalStringResource::data()| has to be stable between |Lock()| and
254
- * |Unlock()|, that is the string must behave as is |IsCacheable()| returned
255
- * true.
256
- *
257
- * These two functions must be thread-safe, and can be called from anywhere.
258
- * They also must handle lock depth, in the sense that each can be called
259
- * several times, from different threads, and unlocking should only happen
260
- * when the balance of Lock() and Unlock() calls is 0.
261
- */
262
- virtual void Lock() const {}
263
-
264
- /**
265
- * Unlocks the string.
266
- */
267
- virtual void Unlock() const {}
268
-
269
- private:
270
- friend class internal::ExternalString;
271
- friend class v8::String;
272
- friend class internal::ScopedExternalStringLock;
273
- };
274
-
275
- /**
276
- * An ExternalStringResource is a wrapper around a two-byte string
277
- * buffer that resides outside V8's heap. Implement an
278
- * ExternalStringResource to manage the life cycle of the underlying
279
- * buffer. Note that the string data must be immutable.
280
- */
281
- class V8_EXPORT ExternalStringResource : public ExternalStringResourceBase {
282
- public:
283
- /**
284
- * Override the destructor to manage the life cycle of the underlying
285
- * buffer.
286
- */
287
- ~ExternalStringResource() override = default;
288
-
289
- /**
290
- * The string data from the underlying buffer. If the resource is cacheable
291
- * then data() must return the same value for all invocations.
292
- */
293
- virtual const uint16_t* data() const = 0;
294
-
295
- /**
296
- * The length of the string. That is, the number of two-byte characters.
297
- */
298
- virtual size_t length() const = 0;
299
-
300
- /**
301
- * Returns the cached data from the underlying buffer. This method can be
302
- * called only for cacheable resources (i.e. IsCacheable() == true) and only
303
- * after UpdateDataCache() was called.
304
- */
305
- const uint16_t* cached_data() const {
306
- CheckCachedDataInvariants();
307
- return cached_data_;
308
- }
309
-
310
- /**
311
- * Update {cached_data_} with the data from the underlying buffer. This can
312
- * be called only for cacheable resources.
313
- */
314
- void UpdateDataCache();
315
-
316
- protected:
317
- ExternalStringResource() = default;
318
-
319
- private:
320
- void CheckCachedDataInvariants() const;
321
-
322
- const uint16_t* cached_data_ = nullptr;
323
- };
324
-
325
- /**
326
- * An ExternalOneByteStringResource is a wrapper around an one-byte
327
- * string buffer that resides outside V8's heap. Implement an
328
- * ExternalOneByteStringResource to manage the life cycle of the
329
- * underlying buffer. Note that the string data must be immutable
330
- * and that the data must be Latin-1 and not UTF-8, which would require
331
- * special treatment internally in the engine and do not allow efficient
332
- * indexing. Use String::New or convert to 16 bit data for non-Latin1.
333
- */
334
-
335
- class V8_EXPORT ExternalOneByteStringResource
336
- : public ExternalStringResourceBase {
337
- public:
338
- /**
339
- * Override the destructor to manage the life cycle of the underlying
340
- * buffer.
341
- */
342
- ~ExternalOneByteStringResource() override = default;
343
-
344
- /**
345
- * The string data from the underlying buffer. If the resource is cacheable
346
- * then data() must return the same value for all invocations.
347
- */
348
- virtual const char* data() const = 0;
349
-
350
- /** The number of Latin-1 characters in the string.*/
351
- virtual size_t length() const = 0;
352
-
353
- /**
354
- * Returns the cached data from the underlying buffer. If the resource is
355
- * uncacheable or if UpdateDataCache() was not called before, it has
356
- * undefined behaviour.
357
- */
358
- const char* cached_data() const {
359
- CheckCachedDataInvariants();
360
- return cached_data_;
361
- }
362
-
363
- /**
364
- * Update {cached_data_} with the data from the underlying buffer. This can
365
- * be called only for cacheable resources.
366
- */
367
- void UpdateDataCache();
368
-
369
- protected:
370
- ExternalOneByteStringResource() = default;
371
-
372
- private:
373
- void CheckCachedDataInvariants() const;
374
-
375
- const char* cached_data_ = nullptr;
376
- };
377
-
378
- /**
379
- * If the string is an external string, return the ExternalStringResourceBase
380
- * regardless of the encoding, otherwise return NULL. The encoding of the
381
- * string is returned in encoding_out.
382
- */
383
- V8_INLINE ExternalStringResourceBase* GetExternalStringResourceBase(
384
- Encoding* encoding_out) const;
385
-
386
- /**
387
- * Get the ExternalStringResource for an external string. Returns
388
- * NULL if IsExternal() doesn't return true.
389
- */
390
- V8_INLINE ExternalStringResource* GetExternalStringResource() const;
391
-
392
- /**
393
- * Get the ExternalOneByteStringResource for an external one-byte string.
394
- * Returns NULL if IsExternalOneByte() doesn't return true.
395
- */
396
- const ExternalOneByteStringResource* GetExternalOneByteStringResource() const;
397
-
398
- V8_INLINE static String* Cast(v8::Data* data) {
399
- #ifdef V8_ENABLE_CHECKS
400
- CheckCast(data);
401
- #endif
402
- return static_cast<String*>(data);
403
- }
404
-
405
- /**
406
- * Allocates a new string from a UTF-8 literal. This is equivalent to calling
407
- * String::NewFromUtf(isolate, "...").ToLocalChecked(), but without the check
408
- * overhead.
409
- *
410
- * When called on a string literal containing '\0', the inferred length is the
411
- * length of the input array minus 1 (for the final '\0') and not the value
412
- * returned by strlen.
413
- **/
414
- template <int N>
415
- static V8_WARN_UNUSED_RESULT Local<String> NewFromUtf8Literal(
416
- Isolate* isolate, const char (&literal)[N],
417
- NewStringType type = NewStringType::kNormal) {
418
- static_assert(N <= kMaxLength, "String is too long");
419
- return NewFromUtf8Literal(isolate, literal, type, N - 1);
420
- }
421
-
422
- /** Allocates a new string from UTF-8 data. Only returns an empty value when
423
- * length > kMaxLength. **/
424
- static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromUtf8(
425
- Isolate* isolate, const char* data,
426
- NewStringType type = NewStringType::kNormal, int length = -1);
427
-
428
- /** Allocates a new string from Latin-1 data. Only returns an empty value
429
- * when length > kMaxLength. **/
430
- static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte(
431
- Isolate* isolate, const uint8_t* data,
432
- NewStringType type = NewStringType::kNormal, int length = -1);
433
-
434
- /** Allocates a new string from UTF-16 data. Only returns an empty value when
435
- * length > kMaxLength. **/
436
- static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromTwoByte(
437
- Isolate* isolate, const uint16_t* data,
438
- NewStringType type = NewStringType::kNormal, int length = -1);
439
-
440
- /**
441
- * Creates a new string by concatenating the left and the right strings
442
- * passed in as parameters.
443
- */
444
- static Local<String> Concat(Isolate* isolate, Local<String> left,
445
- Local<String> right);
446
-
447
- /**
448
- * Creates a new external string using the data defined in the given
449
- * resource. When the external string is no longer live on V8's heap the
450
- * resource will be disposed by calling its Dispose method. The caller of
451
- * this function should not otherwise delete or modify the resource. Neither
452
- * should the underlying buffer be deallocated or modified except through the
453
- * destructor of the external string resource.
454
- */
455
- static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalTwoByte(
456
- Isolate* isolate, ExternalStringResource* resource);
457
-
458
- /**
459
- * Associate an external string resource with this string by transforming it
460
- * in place so that existing references to this string in the JavaScript heap
461
- * will use the external string resource. The external string resource's
462
- * character contents need to be equivalent to this string.
463
- * Returns true if the string has been changed to be an external string.
464
- * The string is not modified if the operation fails. See NewExternal for
465
- * information on the lifetime of the resource.
466
- */
467
- bool MakeExternal(ExternalStringResource* resource);
468
-
469
- /**
470
- * Creates a new external string using the one-byte data defined in the given
471
- * resource. When the external string is no longer live on V8's heap the
472
- * resource will be disposed by calling its Dispose method. The caller of
473
- * this function should not otherwise delete or modify the resource. Neither
474
- * should the underlying buffer be deallocated or modified except through the
475
- * destructor of the external string resource.
476
- */
477
- static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalOneByte(
478
- Isolate* isolate, ExternalOneByteStringResource* resource);
479
-
480
- /**
481
- * Associate an external string resource with this string by transforming it
482
- * in place so that existing references to this string in the JavaScript heap
483
- * will use the external string resource. The external string resource's
484
- * character contents need to be equivalent to this string.
485
- * Returns true if the string has been changed to be an external string.
486
- * The string is not modified if the operation fails. See NewExternal for
487
- * information on the lifetime of the resource.
488
- */
489
- bool MakeExternal(ExternalOneByteStringResource* resource);
490
-
491
- /**
492
- * Returns true if this string can be made external.
493
- */
494
- bool CanMakeExternal() const;
495
-
496
- /**
497
- * Returns true if the strings values are equal. Same as JS ==/===.
498
- */
499
- bool StringEquals(Local<String> str) const;
500
-
501
- /**
502
- * Converts an object to a UTF-8-encoded character array. Useful if
503
- * you want to print the object. If conversion to a string fails
504
- * (e.g. due to an exception in the toString() method of the object)
505
- * then the length() method returns 0 and the * operator returns
506
- * NULL.
507
- */
508
- class V8_EXPORT Utf8Value {
509
- public:
510
- Utf8Value(Isolate* isolate, Local<v8::Value> obj);
511
- ~Utf8Value();
512
- char* operator*() { return str_; }
513
- const char* operator*() const { return str_; }
514
- int length() const { return length_; }
515
-
516
- // Disallow copying and assigning.
517
- Utf8Value(const Utf8Value&) = delete;
518
- void operator=(const Utf8Value&) = delete;
519
-
520
- private:
521
- char* str_;
522
- int length_;
523
- };
524
-
525
- /**
526
- * Converts an object to a two-byte (UTF-16-encoded) string.
527
- * If conversion to a string fails (eg. due to an exception in the toString()
528
- * method of the object) then the length() method returns 0 and the * operator
529
- * returns NULL.
530
- */
531
- class V8_EXPORT Value {
532
- public:
533
- Value(Isolate* isolate, Local<v8::Value> obj);
534
- ~Value();
535
- uint16_t* operator*() { return str_; }
536
- const uint16_t* operator*() const { return str_; }
537
- int length() const { return length_; }
538
-
539
- // Disallow copying and assigning.
540
- Value(const Value&) = delete;
541
- void operator=(const Value&) = delete;
542
-
543
- private:
544
- uint16_t* str_;
545
- int length_;
546
- };
547
-
548
- private:
549
- void VerifyExternalStringResourceBase(ExternalStringResourceBase* v,
550
- Encoding encoding) const;
551
- void VerifyExternalStringResource(ExternalStringResource* val) const;
552
- ExternalStringResource* GetExternalStringResourceSlow() const;
553
- ExternalStringResourceBase* GetExternalStringResourceBaseSlow(
554
- String::Encoding* encoding_out) const;
555
-
556
- static Local<v8::String> NewFromUtf8Literal(Isolate* isolate,
557
- const char* literal,
558
- NewStringType type, int length);
559
-
560
- static void CheckCast(v8::Data* that);
561
- };
562
-
563
- // Zero-length string specialization (templated string size includes
564
- // terminator).
565
- template <>
566
- inline V8_WARN_UNUSED_RESULT Local<String> String::NewFromUtf8Literal(
567
- Isolate* isolate, const char (&literal)[1], NewStringType type) {
568
- return String::Empty(isolate);
569
- }
570
-
571
- /**
572
- * Interface for iterating through all external resources in the heap.
573
- */
574
- class V8_EXPORT ExternalResourceVisitor {
575
- public:
576
- virtual ~ExternalResourceVisitor() = default;
577
- virtual void VisitExternalString(Local<String> string) {}
578
- };
579
-
580
- /**
581
- * A JavaScript symbol (ECMA-262 edition 6)
582
- */
583
- class V8_EXPORT Symbol : public Name {
584
- public:
585
- /**
586
- * Returns the description string of the symbol, or undefined if none.
587
- */
588
- Local<Value> Description(Isolate* isolate) const;
589
-
590
- /**
591
- * Create a symbol. If description is not empty, it will be used as the
592
- * description.
593
- */
594
- static Local<Symbol> New(Isolate* isolate,
595
- Local<String> description = Local<String>());
596
-
597
- /**
598
- * Access global symbol registry.
599
- * Note that symbols created this way are never collected, so
600
- * they should only be used for statically fixed properties.
601
- * Also, there is only one global name space for the descriptions used as
602
- * keys.
603
- * To minimize the potential for clashes, use qualified names as keys.
604
- */
605
- static Local<Symbol> For(Isolate* isolate, Local<String> description);
606
-
607
- /**
608
- * Retrieve a global symbol. Similar to |For|, but using a separate
609
- * registry that is not accessible by (and cannot clash with) JavaScript code.
610
- */
611
- static Local<Symbol> ForApi(Isolate* isolate, Local<String> description);
612
-
613
- // Well-known symbols
614
- static Local<Symbol> GetAsyncIterator(Isolate* isolate);
615
- static Local<Symbol> GetHasInstance(Isolate* isolate);
616
- static Local<Symbol> GetIsConcatSpreadable(Isolate* isolate);
617
- static Local<Symbol> GetIterator(Isolate* isolate);
618
- static Local<Symbol> GetMatch(Isolate* isolate);
619
- static Local<Symbol> GetReplace(Isolate* isolate);
620
- static Local<Symbol> GetSearch(Isolate* isolate);
621
- static Local<Symbol> GetSplit(Isolate* isolate);
622
- static Local<Symbol> GetToPrimitive(Isolate* isolate);
623
- static Local<Symbol> GetToStringTag(Isolate* isolate);
624
- static Local<Symbol> GetUnscopables(Isolate* isolate);
625
-
626
- V8_INLINE static Symbol* Cast(Data* data) {
627
- #ifdef V8_ENABLE_CHECKS
628
- CheckCast(data);
629
- #endif
630
- return static_cast<Symbol*>(data);
631
- }
632
-
633
- private:
634
- Symbol();
635
- static void CheckCast(Data* that);
636
- };
637
-
638
- /**
639
- * A JavaScript number value (ECMA-262, 4.3.20)
640
- */
641
- class V8_EXPORT Number : public Primitive {
642
- public:
643
- double Value() const;
644
- static Local<Number> New(Isolate* isolate, double value);
645
- V8_INLINE static Number* Cast(v8::Data* data) {
646
- #ifdef V8_ENABLE_CHECKS
647
- CheckCast(data);
648
- #endif
649
- return static_cast<Number*>(data);
650
- }
651
-
652
- private:
653
- Number();
654
- static void CheckCast(v8::Data* that);
655
- };
656
-
657
- /**
658
- * A JavaScript value representing a signed integer.
659
- */
660
- class V8_EXPORT Integer : public Number {
661
- public:
662
- static Local<Integer> New(Isolate* isolate, int32_t value);
663
- static Local<Integer> NewFromUnsigned(Isolate* isolate, uint32_t value);
664
- int64_t Value() const;
665
- V8_INLINE static Integer* Cast(v8::Data* data) {
666
- #ifdef V8_ENABLE_CHECKS
667
- CheckCast(data);
668
- #endif
669
- return static_cast<Integer*>(data);
670
- }
671
-
672
- private:
673
- Integer();
674
- static void CheckCast(v8::Data* that);
675
- };
676
-
677
- /**
678
- * A JavaScript value representing a 32-bit signed integer.
679
- */
680
- class V8_EXPORT Int32 : public Integer {
681
- public:
682
- int32_t Value() const;
683
- V8_INLINE static Int32* Cast(v8::Data* data) {
684
- #ifdef V8_ENABLE_CHECKS
685
- CheckCast(data);
686
- #endif
687
- return static_cast<Int32*>(data);
688
- }
689
-
690
- private:
691
- Int32();
692
- static void CheckCast(v8::Data* that);
693
- };
694
-
695
- /**
696
- * A JavaScript value representing a 32-bit unsigned integer.
697
- */
698
- class V8_EXPORT Uint32 : public Integer {
699
- public:
700
- uint32_t Value() const;
701
- V8_INLINE static Uint32* Cast(v8::Data* data) {
702
- #ifdef V8_ENABLE_CHECKS
703
- CheckCast(data);
704
- #endif
705
- return static_cast<Uint32*>(data);
706
- }
707
-
708
- private:
709
- Uint32();
710
- static void CheckCast(v8::Data* that);
711
- };
712
-
713
- /**
714
- * A JavaScript BigInt value (https://tc39.github.io/proposal-bigint)
715
- */
716
- class V8_EXPORT BigInt : public Primitive {
717
- public:
718
- static Local<BigInt> New(Isolate* isolate, int64_t value);
719
- static Local<BigInt> NewFromUnsigned(Isolate* isolate, uint64_t value);
720
- /**
721
- * Creates a new BigInt object using a specified sign bit and a
722
- * specified list of digits/words.
723
- * The resulting number is calculated as:
724
- *
725
- * (-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...)
726
- */
727
- static MaybeLocal<BigInt> NewFromWords(Local<Context> context, int sign_bit,
728
- int word_count, const uint64_t* words);
729
-
730
- /**
731
- * Returns the value of this BigInt as an unsigned 64-bit integer.
732
- * If `lossless` is provided, it will reflect whether the return value was
733
- * truncated or wrapped around. In particular, it is set to `false` if this
734
- * BigInt is negative.
735
- */
736
- uint64_t Uint64Value(bool* lossless = nullptr) const;
737
-
738
- /**
739
- * Returns the value of this BigInt as a signed 64-bit integer.
740
- * If `lossless` is provided, it will reflect whether this BigInt was
741
- * truncated or not.
742
- */
743
- int64_t Int64Value(bool* lossless = nullptr) const;
744
-
745
- /**
746
- * Returns the number of 64-bit words needed to store the result of
747
- * ToWordsArray().
748
- */
749
- int WordCount() const;
750
-
751
- /**
752
- * Writes the contents of this BigInt to a specified memory location.
753
- * `sign_bit` must be provided and will be set to 1 if this BigInt is
754
- * negative.
755
- * `*word_count` has to be initialized to the length of the `words` array.
756
- * Upon return, it will be set to the actual number of words that would
757
- * be needed to store this BigInt (i.e. the return value of `WordCount()`).
758
- */
759
- void ToWordsArray(int* sign_bit, int* word_count, uint64_t* words) const;
760
-
761
- V8_INLINE static BigInt* Cast(v8::Data* data) {
762
- #ifdef V8_ENABLE_CHECKS
763
- CheckCast(data);
764
- #endif
765
- return static_cast<BigInt*>(data);
766
- }
767
-
768
- private:
769
- BigInt();
770
- static void CheckCast(v8::Data* that);
771
- };
772
-
773
- Local<String> String::Empty(Isolate* isolate) {
774
- using S = internal::Address;
775
- using I = internal::Internals;
776
- I::CheckInitialized(isolate);
777
- S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex);
778
- return Local<String>(reinterpret_cast<String*>(slot));
779
- }
780
-
781
- String::ExternalStringResource* String::GetExternalStringResource() const {
782
- using A = internal::Address;
783
- using I = internal::Internals;
784
- A obj = *reinterpret_cast<const A*>(this);
785
-
786
- ExternalStringResource* result;
787
- if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
788
- internal::Isolate* isolate = I::GetIsolateForSandbox(obj);
789
- A value =
790
- I::ReadExternalPointerField(isolate, obj, I::kStringResourceOffset,
791
- internal::kExternalStringResourceTag);
792
- result = reinterpret_cast<String::ExternalStringResource*>(value);
793
- } else {
794
- result = GetExternalStringResourceSlow();
795
- }
796
- #ifdef V8_ENABLE_CHECKS
797
- VerifyExternalStringResource(result);
798
- #endif
799
- return result;
800
- }
801
-
802
- String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
803
- String::Encoding* encoding_out) const {
804
- using A = internal::Address;
805
- using I = internal::Internals;
806
- A obj = *reinterpret_cast<const A*>(this);
807
- int type = I::GetInstanceType(obj) & I::kStringRepresentationAndEncodingMask;
808
- *encoding_out = static_cast<Encoding>(type & I::kStringEncodingMask);
809
- ExternalStringResourceBase* resource;
810
- if (type == I::kExternalOneByteRepresentationTag ||
811
- type == I::kExternalTwoByteRepresentationTag) {
812
- internal::Isolate* isolate = I::GetIsolateForSandbox(obj);
813
- A value =
814
- I::ReadExternalPointerField(isolate, obj, I::kStringResourceOffset,
815
- internal::kExternalStringResourceTag);
816
- resource = reinterpret_cast<ExternalStringResourceBase*>(value);
817
- } else {
818
- resource = GetExternalStringResourceBaseSlow(encoding_out);
819
- }
820
- #ifdef V8_ENABLE_CHECKS
821
- VerifyExternalStringResourceBase(resource, *encoding_out);
822
- #endif
823
- return resource;
824
- }
825
-
826
- // --- Statics ---
827
-
828
- V8_INLINE Local<Primitive> Undefined(Isolate* isolate) {
829
- using S = internal::Address;
830
- using I = internal::Internals;
831
- I::CheckInitialized(isolate);
832
- S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
833
- return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
834
- }
835
-
836
- V8_INLINE Local<Primitive> Null(Isolate* isolate) {
837
- using S = internal::Address;
838
- using I = internal::Internals;
839
- I::CheckInitialized(isolate);
840
- S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
841
- return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
842
- }
843
-
844
- V8_INLINE Local<Boolean> True(Isolate* isolate) {
845
- using S = internal::Address;
846
- using I = internal::Internals;
847
- I::CheckInitialized(isolate);
848
- S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
849
- return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
850
- }
851
-
852
- V8_INLINE Local<Boolean> False(Isolate* isolate) {
853
- using S = internal::Address;
854
- using I = internal::Internals;
855
- I::CheckInitialized(isolate);
856
- S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
857
- return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
858
- }
859
-
860
- Local<Boolean> Boolean::New(Isolate* isolate, bool value) {
861
- return value ? True(isolate) : False(isolate);
862
- }
863
-
864
- } // namespace v8
865
-
866
- #endif // INCLUDE_V8_PRIMITIVE_H_