@triniwiz/nativescript-masonkit 1.0.0-alpha.9 → 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,1079 +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_TEMPLATE_H_
6
- #define INCLUDE_V8_TEMPLATE_H_
7
-
8
- #include "v8-data.h" // NOLINT(build/include_directory)
9
- #include "v8-function-callback.h" // NOLINT(build/include_directory)
10
- #include "v8-local-handle.h" // NOLINT(build/include_directory)
11
- #include "v8-memory-span.h" // NOLINT(build/include_directory)
12
- #include "v8-object.h" // NOLINT(build/include_directory)
13
- #include "v8config.h" // NOLINT(build/include_directory)
14
-
15
- namespace v8 {
16
-
17
- class AccessorSignature;
18
- class CFunction;
19
- class FunctionTemplate;
20
- class ObjectTemplate;
21
- class Signature;
22
-
23
- // --- Templates ---
24
-
25
- #define V8_INTRINSICS_LIST(F) \
26
- F(ArrayProto_entries, array_entries_iterator) \
27
- F(ArrayProto_forEach, array_for_each_iterator) \
28
- F(ArrayProto_keys, array_keys_iterator) \
29
- F(ArrayProto_values, array_values_iterator) \
30
- F(ArrayPrototype, initial_array_prototype) \
31
- F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
32
- F(ErrorPrototype, initial_error_prototype) \
33
- F(IteratorPrototype, initial_iterator_prototype) \
34
- F(ObjProto_valueOf, object_value_of_function)
35
-
36
- enum Intrinsic {
37
- #define V8_DECL_INTRINSIC(name, iname) k##name,
38
- V8_INTRINSICS_LIST(V8_DECL_INTRINSIC)
39
- #undef V8_DECL_INTRINSIC
40
- };
41
-
42
- /**
43
- * The superclass of object and function templates.
44
- */
45
- class V8_EXPORT Template : public Data {
46
- public:
47
- /**
48
- * Adds a property to each instance created by this template.
49
- *
50
- * The property must be defined either as a primitive value, or a template.
51
- */
52
- void Set(Local<Name> name, Local<Data> value,
53
- PropertyAttribute attributes = None);
54
- void SetPrivate(Local<Private> name, Local<Data> value,
55
- PropertyAttribute attributes = None);
56
- V8_INLINE void Set(Isolate* isolate, const char* name, Local<Data> value,
57
- PropertyAttribute attributes = None);
58
-
59
- void SetAccessorProperty(
60
- Local<Name> name,
61
- Local<FunctionTemplate> getter = Local<FunctionTemplate>(),
62
- Local<FunctionTemplate> setter = Local<FunctionTemplate>(),
63
- PropertyAttribute attribute = None, AccessControl settings = DEFAULT);
64
-
65
- /**
66
- * Whenever the property with the given name is accessed on objects
67
- * created from this Template the getter and setter callbacks
68
- * are called instead of getting and setting the property directly
69
- * on the JavaScript object.
70
- *
71
- * \param name The name of the property for which an accessor is added.
72
- * \param getter The callback to invoke when getting the property.
73
- * \param setter The callback to invoke when setting the property.
74
- * \param data A piece of data that will be passed to the getter and setter
75
- * callbacks whenever they are invoked.
76
- * \param settings Access control settings for the accessor. This is a bit
77
- * field consisting of one of more of
78
- * DEFAULT = 0, ALL_CAN_READ = 1, or ALL_CAN_WRITE = 2.
79
- * The default is to not allow cross-context access.
80
- * ALL_CAN_READ means that all cross-context reads are allowed.
81
- * ALL_CAN_WRITE means that all cross-context writes are allowed.
82
- * The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow all
83
- * cross-context access.
84
- * \param attribute The attributes of the property for which an accessor
85
- * is added.
86
- * \param signature The signature describes valid receivers for the accessor
87
- * and is used to perform implicit instance checks against them. If the
88
- * receiver is incompatible (i.e. is not an instance of the constructor as
89
- * defined by FunctionTemplate::HasInstance()), an implicit TypeError is
90
- * thrown and no callback is invoked.
91
- */
92
- V8_DEPRECATED("Do signature check in accessor")
93
- void SetNativeDataProperty(
94
- Local<String> name, AccessorGetterCallback getter,
95
- AccessorSetterCallback setter, Local<Value> data,
96
- PropertyAttribute attribute, Local<AccessorSignature> signature,
97
- AccessControl settings = DEFAULT,
98
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
99
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
100
- V8_DEPRECATED("Do signature check in accessor")
101
- void SetNativeDataProperty(
102
- Local<Name> name, AccessorNameGetterCallback getter,
103
- AccessorNameSetterCallback setter, Local<Value> data,
104
- PropertyAttribute attribute, Local<AccessorSignature> signature,
105
- AccessControl settings = DEFAULT,
106
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
107
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
108
- void SetNativeDataProperty(
109
- Local<String> name, AccessorGetterCallback getter,
110
- AccessorSetterCallback setter = nullptr,
111
- Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
112
- AccessControl settings = DEFAULT,
113
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
114
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
115
- void SetNativeDataProperty(
116
- Local<Name> name, AccessorNameGetterCallback getter,
117
- AccessorNameSetterCallback setter = nullptr,
118
- Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
119
- AccessControl settings = DEFAULT,
120
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
121
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
122
-
123
- /**
124
- * Like SetNativeDataProperty, but V8 will replace the native data property
125
- * with a real data property on first access.
126
- */
127
- void SetLazyDataProperty(
128
- Local<Name> name, AccessorNameGetterCallback getter,
129
- Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
130
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
131
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
132
-
133
- /**
134
- * During template instantiation, sets the value with the intrinsic property
135
- * from the correct context.
136
- */
137
- void SetIntrinsicDataProperty(Local<Name> name, Intrinsic intrinsic,
138
- PropertyAttribute attribute = None);
139
-
140
- private:
141
- Template();
142
-
143
- friend class ObjectTemplate;
144
- friend class FunctionTemplate;
145
- };
146
-
147
- // TODO(dcarney): Replace GenericNamedPropertyFooCallback with just
148
- // NamedPropertyFooCallback.
149
-
150
- /**
151
- * Interceptor for get requests on an object.
152
- *
153
- * Use `info.GetReturnValue().Set()` to set the return value of the
154
- * intercepted get request.
155
- *
156
- * \param property The name of the property for which the request was
157
- * intercepted.
158
- * \param info Information about the intercepted request, such as
159
- * isolate, receiver, return value, or whether running in `'use strict`' mode.
160
- * See `PropertyCallbackInfo`.
161
- *
162
- * \code
163
- * void GetterCallback(
164
- * Local<Name> name,
165
- * const v8::PropertyCallbackInfo<v8::Value>& info) {
166
- * info.GetReturnValue().Set(v8_num(42));
167
- * }
168
- *
169
- * v8::Local<v8::FunctionTemplate> templ =
170
- * v8::FunctionTemplate::New(isolate);
171
- * templ->InstanceTemplate()->SetHandler(
172
- * v8::NamedPropertyHandlerConfiguration(GetterCallback));
173
- * LocalContext env;
174
- * env->Global()
175
- * ->Set(env.local(), v8_str("obj"), templ->GetFunction(env.local())
176
- * .ToLocalChecked()
177
- * ->NewInstance(env.local())
178
- * .ToLocalChecked())
179
- * .FromJust();
180
- * v8::Local<v8::Value> result = CompileRun("obj.a = 17; obj.a");
181
- * CHECK(v8_num(42)->Equals(env.local(), result).FromJust());
182
- * \endcode
183
- *
184
- * See also `ObjectTemplate::SetHandler`.
185
- */
186
- using GenericNamedPropertyGetterCallback =
187
- void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info);
188
-
189
- /**
190
- * Interceptor for set requests on an object.
191
- *
192
- * Use `info.GetReturnValue()` to indicate whether the request was intercepted
193
- * or not. If the setter successfully intercepts the request, i.e., if the
194
- * request should not be further executed, call
195
- * `info.GetReturnValue().Set(value)`. If the setter
196
- * did not intercept the request, i.e., if the request should be handled as
197
- * if no interceptor is present, do not not call `Set()`.
198
- *
199
- * \param property The name of the property for which the request was
200
- * intercepted.
201
- * \param value The value which the property will have if the request
202
- * is not intercepted.
203
- * \param info Information about the intercepted request, such as
204
- * isolate, receiver, return value, or whether running in `'use strict'` mode.
205
- * See `PropertyCallbackInfo`.
206
- *
207
- * See also
208
- * `ObjectTemplate::SetHandler.`
209
- */
210
- using GenericNamedPropertySetterCallback =
211
- void (*)(Local<Name> property, Local<Value> value,
212
- const PropertyCallbackInfo<Value>& info);
213
-
214
- /**
215
- * Intercepts all requests that query the attributes of the
216
- * property, e.g., getOwnPropertyDescriptor(), propertyIsEnumerable(), and
217
- * defineProperty().
218
- *
219
- * Use `info.GetReturnValue().Set(value)` to set the property attributes. The
220
- * value is an integer encoding a `v8::PropertyAttribute`.
221
- *
222
- * \param property The name of the property for which the request was
223
- * intercepted.
224
- * \param info Information about the intercepted request, such as
225
- * isolate, receiver, return value, or whether running in `'use strict'` mode.
226
- * See `PropertyCallbackInfo`.
227
- *
228
- * \note Some functions query the property attributes internally, even though
229
- * they do not return the attributes. For example, `hasOwnProperty()` can
230
- * trigger this interceptor depending on the state of the object.
231
- *
232
- * See also
233
- * `ObjectTemplate::SetHandler.`
234
- */
235
- using GenericNamedPropertyQueryCallback =
236
- void (*)(Local<Name> property, const PropertyCallbackInfo<Integer>& info);
237
-
238
- /**
239
- * Interceptor for delete requests on an object.
240
- *
241
- * Use `info.GetReturnValue()` to indicate whether the request was intercepted
242
- * or not. If the deleter successfully intercepts the request, i.e., if the
243
- * request should not be further executed, call
244
- * `info.GetReturnValue().Set(value)` with a boolean `value`. The `value` is
245
- * used as the return value of `delete`.
246
- *
247
- * \param property The name of the property for which the request was
248
- * intercepted.
249
- * \param info Information about the intercepted request, such as
250
- * isolate, receiver, return value, or whether running in `'use strict'` mode.
251
- * See `PropertyCallbackInfo`.
252
- *
253
- * \note If you need to mimic the behavior of `delete`, i.e., throw in strict
254
- * mode instead of returning false, use `info.ShouldThrowOnError()` to determine
255
- * if you are in strict mode.
256
- *
257
- * See also `ObjectTemplate::SetHandler.`
258
- */
259
- using GenericNamedPropertyDeleterCallback =
260
- void (*)(Local<Name> property, const PropertyCallbackInfo<Boolean>& info);
261
-
262
- /**
263
- * Returns an array containing the names of the properties the named
264
- * property getter intercepts.
265
- *
266
- * Note: The values in the array must be of type v8::Name.
267
- */
268
- using GenericNamedPropertyEnumeratorCallback =
269
- void (*)(const PropertyCallbackInfo<Array>& info);
270
-
271
- /**
272
- * Interceptor for defineProperty requests on an object.
273
- *
274
- * Use `info.GetReturnValue()` to indicate whether the request was intercepted
275
- * or not. If the definer successfully intercepts the request, i.e., if the
276
- * request should not be further executed, call
277
- * `info.GetReturnValue().Set(value)`. If the definer
278
- * did not intercept the request, i.e., if the request should be handled as
279
- * if no interceptor is present, do not not call `Set()`.
280
- *
281
- * \param property The name of the property for which the request was
282
- * intercepted.
283
- * \param desc The property descriptor which is used to define the
284
- * property if the request is not intercepted.
285
- * \param info Information about the intercepted request, such as
286
- * isolate, receiver, return value, or whether running in `'use strict'` mode.
287
- * See `PropertyCallbackInfo`.
288
- *
289
- * See also `ObjectTemplate::SetHandler`.
290
- */
291
- using GenericNamedPropertyDefinerCallback =
292
- void (*)(Local<Name> property, const PropertyDescriptor& desc,
293
- const PropertyCallbackInfo<Value>& info);
294
-
295
- /**
296
- * Interceptor for getOwnPropertyDescriptor requests on an object.
297
- *
298
- * Use `info.GetReturnValue().Set()` to set the return value of the
299
- * intercepted request. The return value must be an object that
300
- * can be converted to a PropertyDescriptor, e.g., a `v8::value` returned from
301
- * `v8::Object::getOwnPropertyDescriptor`.
302
- *
303
- * \param property The name of the property for which the request was
304
- * intercepted.
305
- * \info Information about the intercepted request, such as
306
- * isolate, receiver, return value, or whether running in `'use strict'` mode.
307
- * See `PropertyCallbackInfo`.
308
- *
309
- * \note If GetOwnPropertyDescriptor is intercepted, it will
310
- * always return true, i.e., indicate that the property was found.
311
- *
312
- * See also `ObjectTemplate::SetHandler`.
313
- */
314
- using GenericNamedPropertyDescriptorCallback =
315
- void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info);
316
-
317
- /**
318
- * See `v8::GenericNamedPropertyGetterCallback`.
319
- */
320
- using IndexedPropertyGetterCallback =
321
- void (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
322
-
323
- /**
324
- * See `v8::GenericNamedPropertySetterCallback`.
325
- */
326
- using IndexedPropertySetterCallback =
327
- void (*)(uint32_t index, Local<Value> value,
328
- const PropertyCallbackInfo<Value>& info);
329
-
330
- /**
331
- * See `v8::GenericNamedPropertyQueryCallback`.
332
- */
333
- using IndexedPropertyQueryCallback =
334
- void (*)(uint32_t index, const PropertyCallbackInfo<Integer>& info);
335
-
336
- /**
337
- * See `v8::GenericNamedPropertyDeleterCallback`.
338
- */
339
- using IndexedPropertyDeleterCallback =
340
- void (*)(uint32_t index, const PropertyCallbackInfo<Boolean>& info);
341
-
342
- /**
343
- * Returns an array containing the indices of the properties the indexed
344
- * property getter intercepts.
345
- *
346
- * Note: The values in the array must be uint32_t.
347
- */
348
- using IndexedPropertyEnumeratorCallback =
349
- void (*)(const PropertyCallbackInfo<Array>& info);
350
-
351
- /**
352
- * See `v8::GenericNamedPropertyDefinerCallback`.
353
- */
354
- using IndexedPropertyDefinerCallback =
355
- void (*)(uint32_t index, const PropertyDescriptor& desc,
356
- const PropertyCallbackInfo<Value>& info);
357
-
358
- /**
359
- * See `v8::GenericNamedPropertyDescriptorCallback`.
360
- */
361
- using IndexedPropertyDescriptorCallback =
362
- void (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
363
-
364
- /**
365
- * Returns true if the given context should be allowed to access the given
366
- * object.
367
- */
368
- using AccessCheckCallback = bool (*)(Local<Context> accessing_context,
369
- Local<Object> accessed_object,
370
- Local<Value> data);
371
-
372
- enum class ConstructorBehavior { kThrow, kAllow };
373
-
374
- /**
375
- * A FunctionTemplate is used to create functions at runtime. There
376
- * can only be one function created from a FunctionTemplate in a
377
- * context. The lifetime of the created function is equal to the
378
- * lifetime of the context. So in case the embedder needs to create
379
- * temporary functions that can be collected using Scripts is
380
- * preferred.
381
- *
382
- * Any modification of a FunctionTemplate after first instantiation will trigger
383
- * a crash.
384
- *
385
- * A FunctionTemplate can have properties, these properties are added to the
386
- * function object when it is created.
387
- *
388
- * A FunctionTemplate has a corresponding instance template which is
389
- * used to create object instances when the function is used as a
390
- * constructor. Properties added to the instance template are added to
391
- * each object instance.
392
- *
393
- * A FunctionTemplate can have a prototype template. The prototype template
394
- * is used to create the prototype object of the function.
395
- *
396
- * The following example shows how to use a FunctionTemplate:
397
- *
398
- * \code
399
- * v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate);
400
- * t->Set(isolate, "func_property", v8::Number::New(isolate, 1));
401
- *
402
- * v8::Local<v8::Template> proto_t = t->PrototypeTemplate();
403
- * proto_t->Set(isolate,
404
- * "proto_method",
405
- * v8::FunctionTemplate::New(isolate, InvokeCallback));
406
- * proto_t->Set(isolate, "proto_const", v8::Number::New(isolate, 2));
407
- *
408
- * v8::Local<v8::ObjectTemplate> instance_t = t->InstanceTemplate();
409
- * instance_t->SetAccessor(
410
- String::NewFromUtf8Literal(isolate, "instance_accessor"),
411
- * InstanceAccessorCallback);
412
- * instance_t->SetHandler(
413
- * NamedPropertyHandlerConfiguration(PropertyHandlerCallback));
414
- * instance_t->Set(String::NewFromUtf8Literal(isolate, "instance_property"),
415
- * Number::New(isolate, 3));
416
- *
417
- * v8::Local<v8::Function> function = t->GetFunction();
418
- * v8::Local<v8::Object> instance = function->NewInstance();
419
- * \endcode
420
- *
421
- * Let's use "function" as the JS variable name of the function object
422
- * and "instance" for the instance object created above. The function
423
- * and the instance will have the following properties:
424
- *
425
- * \code
426
- * func_property in function == true;
427
- * function.func_property == 1;
428
- *
429
- * function.prototype.proto_method() invokes 'InvokeCallback'
430
- * function.prototype.proto_const == 2;
431
- *
432
- * instance instanceof function == true;
433
- * instance.instance_accessor calls 'InstanceAccessorCallback'
434
- * instance.instance_property == 3;
435
- * \endcode
436
- *
437
- * A FunctionTemplate can inherit from another one by calling the
438
- * FunctionTemplate::Inherit method. The following graph illustrates
439
- * the semantics of inheritance:
440
- *
441
- * \code
442
- * FunctionTemplate Parent -> Parent() . prototype -> { }
443
- * ^ ^
444
- * | Inherit(Parent) | .__proto__
445
- * | |
446
- * FunctionTemplate Child -> Child() . prototype -> { }
447
- * \endcode
448
- *
449
- * A FunctionTemplate 'Child' inherits from 'Parent', the prototype
450
- * object of the Child() function has __proto__ pointing to the
451
- * Parent() function's prototype object. An instance of the Child
452
- * function has all properties on Parent's instance templates.
453
- *
454
- * Let Parent be the FunctionTemplate initialized in the previous
455
- * section and create a Child FunctionTemplate by:
456
- *
457
- * \code
458
- * Local<FunctionTemplate> parent = t;
459
- * Local<FunctionTemplate> child = FunctionTemplate::New();
460
- * child->Inherit(parent);
461
- *
462
- * Local<Function> child_function = child->GetFunction();
463
- * Local<Object> child_instance = child_function->NewInstance();
464
- * \endcode
465
- *
466
- * The Child function and Child instance will have the following
467
- * properties:
468
- *
469
- * \code
470
- * child_func.prototype.__proto__ == function.prototype;
471
- * child_instance.instance_accessor calls 'InstanceAccessorCallback'
472
- * child_instance.instance_property == 3;
473
- * \endcode
474
- *
475
- * The additional 'c_function' parameter refers to a fast API call, which
476
- * must not trigger GC or JavaScript execution, or call into V8 in other
477
- * ways. For more information how to define them, see
478
- * include/v8-fast-api-calls.h. Please note that this feature is still
479
- * experimental.
480
- */
481
- class V8_EXPORT FunctionTemplate : public Template {
482
- public:
483
- /** Creates a function template.*/
484
- static Local<FunctionTemplate> New(
485
- Isolate* isolate, FunctionCallback callback = nullptr,
486
- Local<Value> data = Local<Value>(),
487
- Local<Signature> signature = Local<Signature>(), int length = 0,
488
- ConstructorBehavior behavior = ConstructorBehavior::kAllow,
489
- SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
490
- const CFunction* c_function = nullptr, uint16_t instance_type = 0,
491
- uint16_t allowed_receiver_instance_type_range_start = 0,
492
- uint16_t allowed_receiver_instance_type_range_end = 0);
493
-
494
- /** Creates a function template for multiple overloaded fast API calls.*/
495
- static Local<FunctionTemplate> NewWithCFunctionOverloads(
496
- Isolate* isolate, FunctionCallback callback = nullptr,
497
- Local<Value> data = Local<Value>(),
498
- Local<Signature> signature = Local<Signature>(), int length = 0,
499
- ConstructorBehavior behavior = ConstructorBehavior::kAllow,
500
- SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
501
- const MemorySpan<const CFunction>& c_function_overloads = {});
502
-
503
- /**
504
- * Creates a function template backed/cached by a private property.
505
- */
506
- static Local<FunctionTemplate> NewWithCache(
507
- Isolate* isolate, FunctionCallback callback,
508
- Local<Private> cache_property, Local<Value> data = Local<Value>(),
509
- Local<Signature> signature = Local<Signature>(), int length = 0,
510
- SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
511
-
512
- /** Returns the unique function instance in the current execution context.*/
513
- V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
514
- Local<Context> context);
515
-
516
- /**
517
- * Similar to Context::NewRemoteContext, this creates an instance that
518
- * isn't backed by an actual object.
519
- *
520
- * The InstanceTemplate of this FunctionTemplate must have access checks with
521
- * handlers installed.
522
- */
523
- V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewRemoteInstance();
524
-
525
- /**
526
- * Set the call-handler callback for a FunctionTemplate. This
527
- * callback is called whenever the function created from this
528
- * FunctionTemplate is called. The 'c_function' represents a fast
529
- * API call, see the comment above the class declaration.
530
- */
531
- void SetCallHandler(
532
- FunctionCallback callback, Local<Value> data = Local<Value>(),
533
- SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
534
- const MemorySpan<const CFunction>& c_function_overloads = {});
535
-
536
- /** Set the predefined length property for the FunctionTemplate. */
537
- void SetLength(int length);
538
-
539
- /** Get the InstanceTemplate. */
540
- Local<ObjectTemplate> InstanceTemplate();
541
-
542
- /**
543
- * Causes the function template to inherit from a parent function template.
544
- * This means the function's prototype.__proto__ is set to the parent
545
- * function's prototype.
546
- **/
547
- void Inherit(Local<FunctionTemplate> parent);
548
-
549
- /**
550
- * A PrototypeTemplate is the template used to create the prototype object
551
- * of the function created by this template.
552
- */
553
- Local<ObjectTemplate> PrototypeTemplate();
554
-
555
- /**
556
- * A PrototypeProviderTemplate is another function template whose prototype
557
- * property is used for this template. This is mutually exclusive with setting
558
- * a prototype template indirectly by calling PrototypeTemplate() or using
559
- * Inherit().
560
- **/
561
- void SetPrototypeProviderTemplate(Local<FunctionTemplate> prototype_provider);
562
-
563
- /**
564
- * Set the class name of the FunctionTemplate. This is used for
565
- * printing objects created with the function created from the
566
- * FunctionTemplate as its constructor.
567
- */
568
- void SetClassName(Local<String> name);
569
-
570
- /**
571
- * When set to true, no access check will be performed on the receiver of a
572
- * function call. Currently defaults to true, but this is subject to change.
573
- */
574
- void SetAcceptAnyReceiver(bool value);
575
-
576
- /**
577
- * Sets the ReadOnly flag in the attributes of the 'prototype' property
578
- * of functions created from this FunctionTemplate to true.
579
- */
580
- void ReadOnlyPrototype();
581
-
582
- /**
583
- * Removes the prototype property from functions created from this
584
- * FunctionTemplate.
585
- */
586
- void RemovePrototype();
587
-
588
- /**
589
- * Returns true if the given object is an instance of this function
590
- * template.
591
- */
592
- bool HasInstance(Local<Value> object);
593
-
594
- /**
595
- * Returns true if the given value is an API object that was constructed by an
596
- * instance of this function template (without checking for inheriting
597
- * function templates).
598
- *
599
- * This is an experimental feature and may still change significantly.
600
- */
601
- bool IsLeafTemplateForApiObject(v8::Local<v8::Value> value) const;
602
-
603
- V8_INLINE static FunctionTemplate* Cast(Data* data);
604
-
605
- private:
606
- FunctionTemplate();
607
-
608
- static void CheckCast(Data* that);
609
- friend class Context;
610
- friend class ObjectTemplate;
611
- };
612
-
613
- /**
614
- * Configuration flags for v8::NamedPropertyHandlerConfiguration or
615
- * v8::IndexedPropertyHandlerConfiguration.
616
- */
617
- enum class PropertyHandlerFlags {
618
- /**
619
- * None.
620
- */
621
- kNone = 0,
622
-
623
- /**
624
- * See ALL_CAN_READ above.
625
- */
626
- kAllCanRead = 1,
627
-
628
- /** Will not call into interceptor for properties on the receiver or prototype
629
- * chain, i.e., only call into interceptor for properties that do not exist.
630
- * Currently only valid for named interceptors.
631
- */
632
- kNonMasking = 1 << 1,
633
-
634
- /**
635
- * Will not call into interceptor for symbol lookup. Only meaningful for
636
- * named interceptors.
637
- */
638
- kOnlyInterceptStrings = 1 << 2,
639
-
640
- /**
641
- * The getter, query, enumerator callbacks do not produce side effects.
642
- */
643
- kHasNoSideEffect = 1 << 3,
644
- };
645
-
646
- struct NamedPropertyHandlerConfiguration {
647
- NamedPropertyHandlerConfiguration(
648
- GenericNamedPropertyGetterCallback getter,
649
- GenericNamedPropertySetterCallback setter,
650
- GenericNamedPropertyQueryCallback query,
651
- GenericNamedPropertyDeleterCallback deleter,
652
- GenericNamedPropertyEnumeratorCallback enumerator,
653
- GenericNamedPropertyDefinerCallback definer,
654
- GenericNamedPropertyDescriptorCallback descriptor,
655
- Local<Value> data = Local<Value>(),
656
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
657
- : getter(getter),
658
- setter(setter),
659
- query(query),
660
- deleter(deleter),
661
- enumerator(enumerator),
662
- definer(definer),
663
- descriptor(descriptor),
664
- data(data),
665
- flags(flags) {}
666
-
667
- NamedPropertyHandlerConfiguration(
668
- /** Note: getter is required */
669
- GenericNamedPropertyGetterCallback getter = nullptr,
670
- GenericNamedPropertySetterCallback setter = nullptr,
671
- GenericNamedPropertyQueryCallback query = nullptr,
672
- GenericNamedPropertyDeleterCallback deleter = nullptr,
673
- GenericNamedPropertyEnumeratorCallback enumerator = nullptr,
674
- Local<Value> data = Local<Value>(),
675
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
676
- : getter(getter),
677
- setter(setter),
678
- query(query),
679
- deleter(deleter),
680
- enumerator(enumerator),
681
- definer(nullptr),
682
- descriptor(nullptr),
683
- data(data),
684
- flags(flags) {}
685
-
686
- NamedPropertyHandlerConfiguration(
687
- GenericNamedPropertyGetterCallback getter,
688
- GenericNamedPropertySetterCallback setter,
689
- GenericNamedPropertyDescriptorCallback descriptor,
690
- GenericNamedPropertyDeleterCallback deleter,
691
- GenericNamedPropertyEnumeratorCallback enumerator,
692
- GenericNamedPropertyDefinerCallback definer,
693
- Local<Value> data = Local<Value>(),
694
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
695
- : getter(getter),
696
- setter(setter),
697
- query(nullptr),
698
- deleter(deleter),
699
- enumerator(enumerator),
700
- definer(definer),
701
- descriptor(descriptor),
702
- data(data),
703
- flags(flags) {}
704
-
705
- GenericNamedPropertyGetterCallback getter;
706
- GenericNamedPropertySetterCallback setter;
707
- GenericNamedPropertyQueryCallback query;
708
- GenericNamedPropertyDeleterCallback deleter;
709
- GenericNamedPropertyEnumeratorCallback enumerator;
710
- GenericNamedPropertyDefinerCallback definer;
711
- GenericNamedPropertyDescriptorCallback descriptor;
712
- Local<Value> data;
713
- PropertyHandlerFlags flags;
714
- };
715
-
716
- struct IndexedPropertyHandlerConfiguration {
717
- IndexedPropertyHandlerConfiguration(
718
- IndexedPropertyGetterCallback getter,
719
- IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query,
720
- IndexedPropertyDeleterCallback deleter,
721
- IndexedPropertyEnumeratorCallback enumerator,
722
- IndexedPropertyDefinerCallback definer,
723
- IndexedPropertyDescriptorCallback descriptor,
724
- Local<Value> data = Local<Value>(),
725
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
726
- : getter(getter),
727
- setter(setter),
728
- query(query),
729
- deleter(deleter),
730
- enumerator(enumerator),
731
- definer(definer),
732
- descriptor(descriptor),
733
- data(data),
734
- flags(flags) {}
735
-
736
- IndexedPropertyHandlerConfiguration(
737
- /** Note: getter is required */
738
- IndexedPropertyGetterCallback getter = nullptr,
739
- IndexedPropertySetterCallback setter = nullptr,
740
- IndexedPropertyQueryCallback query = nullptr,
741
- IndexedPropertyDeleterCallback deleter = nullptr,
742
- IndexedPropertyEnumeratorCallback enumerator = nullptr,
743
- Local<Value> data = Local<Value>(),
744
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
745
- : getter(getter),
746
- setter(setter),
747
- query(query),
748
- deleter(deleter),
749
- enumerator(enumerator),
750
- definer(nullptr),
751
- descriptor(nullptr),
752
- data(data),
753
- flags(flags) {}
754
-
755
- IndexedPropertyHandlerConfiguration(
756
- IndexedPropertyGetterCallback getter,
757
- IndexedPropertySetterCallback setter,
758
- IndexedPropertyDescriptorCallback descriptor,
759
- IndexedPropertyDeleterCallback deleter,
760
- IndexedPropertyEnumeratorCallback enumerator,
761
- IndexedPropertyDefinerCallback definer,
762
- Local<Value> data = Local<Value>(),
763
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
764
- : getter(getter),
765
- setter(setter),
766
- query(nullptr),
767
- deleter(deleter),
768
- enumerator(enumerator),
769
- definer(definer),
770
- descriptor(descriptor),
771
- data(data),
772
- flags(flags) {}
773
-
774
- IndexedPropertyGetterCallback getter;
775
- IndexedPropertySetterCallback setter;
776
- IndexedPropertyQueryCallback query;
777
- IndexedPropertyDeleterCallback deleter;
778
- IndexedPropertyEnumeratorCallback enumerator;
779
- IndexedPropertyDefinerCallback definer;
780
- IndexedPropertyDescriptorCallback descriptor;
781
- Local<Value> data;
782
- PropertyHandlerFlags flags;
783
- };
784
-
785
- /**
786
- * An ObjectTemplate is used to create objects at runtime.
787
- *
788
- * Properties added to an ObjectTemplate are added to each object
789
- * created from the ObjectTemplate.
790
- */
791
- class V8_EXPORT ObjectTemplate : public Template {
792
- public:
793
- /** Creates an ObjectTemplate. */
794
- static Local<ObjectTemplate> New(
795
- Isolate* isolate,
796
- Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
797
-
798
- /** Creates a new instance of this template.*/
799
- V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
800
-
801
- /**
802
- * Sets an accessor on the object template.
803
- *
804
- * Whenever the property with the given name is accessed on objects
805
- * created from this ObjectTemplate the getter and setter callbacks
806
- * are called instead of getting and setting the property directly
807
- * on the JavaScript object.
808
- *
809
- * \param name The name of the property for which an accessor is added.
810
- * \param getter The callback to invoke when getting the property.
811
- * \param setter The callback to invoke when setting the property.
812
- * \param data A piece of data that will be passed to the getter and setter
813
- * callbacks whenever they are invoked.
814
- * \param settings Access control settings for the accessor. This is a bit
815
- * field consisting of one of more of
816
- * DEFAULT = 0, ALL_CAN_READ = 1, or ALL_CAN_WRITE = 2.
817
- * The default is to not allow cross-context access.
818
- * ALL_CAN_READ means that all cross-context reads are allowed.
819
- * ALL_CAN_WRITE means that all cross-context writes are allowed.
820
- * The combination ALL_CAN_READ | ALL_CAN_WRITE can be used to allow all
821
- * cross-context access.
822
- * \param attribute The attributes of the property for which an accessor
823
- * is added.
824
- * \param signature The signature describes valid receivers for the accessor
825
- * and is used to perform implicit instance checks against them. If the
826
- * receiver is incompatible (i.e. is not an instance of the constructor as
827
- * defined by FunctionTemplate::HasInstance()), an implicit TypeError is
828
- * thrown and no callback is invoked.
829
- */
830
- V8_DEPRECATED("Do signature check in accessor")
831
- void SetAccessor(
832
- Local<String> name, AccessorGetterCallback getter,
833
- AccessorSetterCallback setter, Local<Value> data, AccessControl settings,
834
- PropertyAttribute attribute, Local<AccessorSignature> signature,
835
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
836
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
837
- V8_DEPRECATED("Do signature check in accessor")
838
- void SetAccessor(
839
- Local<Name> name, AccessorNameGetterCallback getter,
840
- AccessorNameSetterCallback setter, Local<Value> data,
841
- AccessControl settings, PropertyAttribute attribute,
842
- Local<AccessorSignature> signature,
843
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
844
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
845
- void SetAccessor(
846
- Local<String> name, AccessorGetterCallback getter,
847
- AccessorSetterCallback setter = nullptr,
848
- Local<Value> data = Local<Value>(), AccessControl settings = DEFAULT,
849
- PropertyAttribute attribute = None,
850
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
851
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
852
- void SetAccessor(
853
- Local<Name> name, AccessorNameGetterCallback getter,
854
- AccessorNameSetterCallback setter = nullptr,
855
- Local<Value> data = Local<Value>(), AccessControl settings = DEFAULT,
856
- PropertyAttribute attribute = None,
857
- SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
858
- SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
859
-
860
- /**
861
- * Sets a named property handler on the object template.
862
- *
863
- * Whenever a property whose name is a string or a symbol is accessed on
864
- * objects created from this object template, the provided callback is
865
- * invoked instead of accessing the property directly on the JavaScript
866
- * object.
867
- *
868
- * @param configuration The NamedPropertyHandlerConfiguration that defines the
869
- * callbacks to invoke when accessing a property.
870
- */
871
- void SetHandler(const NamedPropertyHandlerConfiguration& configuration);
872
-
873
- /**
874
- * Sets an indexed property handler on the object template.
875
- *
876
- * Whenever an indexed property is accessed on objects created from
877
- * this object template, the provided callback is invoked instead of
878
- * accessing the property directly on the JavaScript object.
879
- *
880
- * \param getter The callback to invoke when getting a property.
881
- * \param setter The callback to invoke when setting a property.
882
- * \param query The callback to invoke to check if an object has a property.
883
- * \param deleter The callback to invoke when deleting a property.
884
- * \param enumerator The callback to invoke to enumerate all the indexed
885
- * properties of an object.
886
- * \param data A piece of data that will be passed to the callbacks
887
- * whenever they are invoked.
888
- */
889
- // TODO(dcarney): deprecate
890
- void SetIndexedPropertyHandler(
891
- IndexedPropertyGetterCallback getter,
892
- IndexedPropertySetterCallback setter = nullptr,
893
- IndexedPropertyQueryCallback query = nullptr,
894
- IndexedPropertyDeleterCallback deleter = nullptr,
895
- IndexedPropertyEnumeratorCallback enumerator = nullptr,
896
- Local<Value> data = Local<Value>()) {
897
- SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query,
898
- deleter, enumerator, data));
899
- }
900
-
901
- /**
902
- * Sets an indexed property handler on the object template.
903
- *
904
- * Whenever an indexed property is accessed on objects created from
905
- * this object template, the provided callback is invoked instead of
906
- * accessing the property directly on the JavaScript object.
907
- *
908
- * @param configuration The IndexedPropertyHandlerConfiguration that defines
909
- * the callbacks to invoke when accessing a property.
910
- */
911
- void SetHandler(const IndexedPropertyHandlerConfiguration& configuration);
912
-
913
- /**
914
- * Sets the callback to be used when calling instances created from
915
- * this template as a function. If no callback is set, instances
916
- * behave like normal JavaScript objects that cannot be called as a
917
- * function.
918
- */
919
- void SetCallAsFunctionHandler(FunctionCallback callback,
920
- Local<Value> data = Local<Value>());
921
-
922
- /**
923
- * Mark object instances of the template as undetectable.
924
- *
925
- * In many ways, undetectable objects behave as though they are not
926
- * there. They behave like 'undefined' in conditionals and when
927
- * printed. However, properties can be accessed and called as on
928
- * normal objects.
929
- */
930
- void MarkAsUndetectable();
931
-
932
- /**
933
- * Sets access check callback on the object template and enables access
934
- * checks.
935
- *
936
- * When accessing properties on instances of this object template,
937
- * the access check callback will be called to determine whether or
938
- * not to allow cross-context access to the properties.
939
- */
940
- void SetAccessCheckCallback(AccessCheckCallback callback,
941
- Local<Value> data = Local<Value>());
942
-
943
- /**
944
- * Like SetAccessCheckCallback but invokes an interceptor on failed access
945
- * checks instead of looking up all-can-read properties. You can only use
946
- * either this method or SetAccessCheckCallback, but not both at the same
947
- * time.
948
- */
949
- void SetAccessCheckCallbackAndHandler(
950
- AccessCheckCallback callback,
951
- const NamedPropertyHandlerConfiguration& named_handler,
952
- const IndexedPropertyHandlerConfiguration& indexed_handler,
953
- Local<Value> data = Local<Value>());
954
-
955
- /**
956
- * Gets the number of internal fields for objects generated from
957
- * this template.
958
- */
959
- int InternalFieldCount() const;
960
-
961
- /**
962
- * Sets the number of internal fields for objects generated from
963
- * this template.
964
- */
965
- void SetInternalFieldCount(int value);
966
-
967
- /**
968
- * Returns true if the object will be an immutable prototype exotic object.
969
- */
970
- bool IsImmutableProto() const;
971
-
972
- /**
973
- * Makes the ObjectTemplate for an immutable prototype exotic object, with an
974
- * immutable __proto__.
975
- */
976
- void SetImmutableProto();
977
-
978
- /**
979
- * Support for TC39 "dynamic code brand checks" proposal.
980
- *
981
- * This API allows to mark (& query) objects as "code like", which causes
982
- * them to be treated like Strings in the context of eval and function
983
- * constructor.
984
- *
985
- * Reference: https://github.com/tc39/proposal-dynamic-code-brand-checks
986
- */
987
- void SetCodeLike();
988
- bool IsCodeLike() const;
989
-
990
- V8_INLINE static ObjectTemplate* Cast(Data* data);
991
-
992
- private:
993
- ObjectTemplate();
994
- static Local<ObjectTemplate> New(internal::Isolate* isolate,
995
- Local<FunctionTemplate> constructor);
996
- static void CheckCast(Data* that);
997
- friend class FunctionTemplate;
998
- };
999
-
1000
- /**
1001
- * A Signature specifies which receiver is valid for a function.
1002
- *
1003
- * A receiver matches a given signature if the receiver (or any of its
1004
- * hidden prototypes) was created from the signature's FunctionTemplate, or
1005
- * from a FunctionTemplate that inherits directly or indirectly from the
1006
- * signature's FunctionTemplate.
1007
- */
1008
- class V8_EXPORT Signature : public Data {
1009
- public:
1010
- static Local<Signature> New(
1011
- Isolate* isolate,
1012
- Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
1013
-
1014
- V8_INLINE static Signature* Cast(Data* data);
1015
-
1016
- private:
1017
- Signature();
1018
-
1019
- static void CheckCast(Data* that);
1020
- };
1021
-
1022
- /**
1023
- * An AccessorSignature specifies which receivers are valid parameters
1024
- * to an accessor callback.
1025
- */
1026
- class V8_EXPORT AccessorSignature : public Data {
1027
- public:
1028
- static Local<AccessorSignature> New(
1029
- Isolate* isolate,
1030
- Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
1031
-
1032
- V8_INLINE static AccessorSignature* Cast(Data* data);
1033
-
1034
- private:
1035
- AccessorSignature();
1036
-
1037
- static void CheckCast(Data* that);
1038
- };
1039
-
1040
- // --- Implementation ---
1041
-
1042
- void Template::Set(Isolate* isolate, const char* name, Local<Data> value,
1043
- PropertyAttribute attributes) {
1044
- Set(String::NewFromUtf8(isolate, name, NewStringType::kInternalized)
1045
- .ToLocalChecked(),
1046
- value, attributes);
1047
- }
1048
-
1049
- FunctionTemplate* FunctionTemplate::Cast(Data* data) {
1050
- #ifdef V8_ENABLE_CHECKS
1051
- CheckCast(data);
1052
- #endif
1053
- return reinterpret_cast<FunctionTemplate*>(data);
1054
- }
1055
-
1056
- ObjectTemplate* ObjectTemplate::Cast(Data* data) {
1057
- #ifdef V8_ENABLE_CHECKS
1058
- CheckCast(data);
1059
- #endif
1060
- return reinterpret_cast<ObjectTemplate*>(data);
1061
- }
1062
-
1063
- Signature* Signature::Cast(Data* data) {
1064
- #ifdef V8_ENABLE_CHECKS
1065
- CheckCast(data);
1066
- #endif
1067
- return reinterpret_cast<Signature*>(data);
1068
- }
1069
-
1070
- AccessorSignature* AccessorSignature::Cast(Data* data) {
1071
- #ifdef V8_ENABLE_CHECKS
1072
- CheckCast(data);
1073
- #endif
1074
- return reinterpret_cast<AccessorSignature*>(data);
1075
- }
1076
-
1077
- } // namespace v8
1078
-
1079
- #endif // INCLUDE_V8_TEMPLATE_H_