@kungfu-tech/libnode-win32-x64 0.0.0-bootstrap.0 → 22.22.3-kf.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 (343) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/dist/node/include/acorn_version.h +6 -0
  4. package/dist/node/include/aliased_buffer-inl.h +244 -0
  5. package/dist/node/include/aliased_buffer.h +206 -0
  6. package/dist/node/include/aliased_struct-inl.h +54 -0
  7. package/dist/node/include/aliased_struct.h +63 -0
  8. package/dist/node/include/amaro_version.h +6 -0
  9. package/dist/node/include/async_context_frame.h +33 -0
  10. package/dist/node/include/async_wrap-inl.h +96 -0
  11. package/dist/node/include/async_wrap.h +243 -0
  12. package/dist/node/include/base_object-inl.h +335 -0
  13. package/dist/node/include/base_object.h +342 -0
  14. package/dist/node/include/base_object_types.h +74 -0
  15. package/dist/node/include/blob_serializer_deserializer-inl.h +385 -0
  16. package/dist/node/include/blob_serializer_deserializer.h +132 -0
  17. package/dist/node/include/callback_queue-inl.h +97 -0
  18. package/dist/node/include/callback_queue.h +79 -0
  19. package/dist/node/include/cares_wrap.h +447 -0
  20. package/dist/node/include/cjs_module_lexer_version.h +6 -0
  21. package/dist/node/include/cleanup_queue-inl.h +36 -0
  22. package/dist/node/include/cleanup_queue.h +79 -0
  23. package/dist/node/include/compile_cache.h +104 -0
  24. package/dist/node/include/connect_wrap.h +26 -0
  25. package/dist/node/include/connection_wrap.h +30 -0
  26. package/dist/node/include/cppgc/allocation.h +310 -0
  27. package/dist/node/include/cppgc/common.h +28 -0
  28. package/dist/node/include/cppgc/cross-thread-persistent.h +466 -0
  29. package/dist/node/include/cppgc/custom-space.h +97 -0
  30. package/dist/node/include/cppgc/default-platform.h +67 -0
  31. package/dist/node/include/cppgc/ephemeron-pair.h +30 -0
  32. package/dist/node/include/cppgc/explicit-management.h +100 -0
  33. package/dist/node/include/cppgc/garbage-collected.h +106 -0
  34. package/dist/node/include/cppgc/heap-consistency.h +309 -0
  35. package/dist/node/include/cppgc/heap-handle.h +48 -0
  36. package/dist/node/include/cppgc/heap-state.h +82 -0
  37. package/dist/node/include/cppgc/heap-statistics.h +120 -0
  38. package/dist/node/include/cppgc/heap.h +202 -0
  39. package/dist/node/include/cppgc/internal/api-constants.h +87 -0
  40. package/dist/node/include/cppgc/internal/atomic-entry-flag.h +48 -0
  41. package/dist/node/include/cppgc/internal/base-page-handle.h +45 -0
  42. package/dist/node/include/cppgc/internal/caged-heap-local-data.h +121 -0
  43. package/dist/node/include/cppgc/internal/caged-heap.h +68 -0
  44. package/dist/node/include/cppgc/internal/compiler-specific.h +38 -0
  45. package/dist/node/include/cppgc/internal/finalizer-trait.h +93 -0
  46. package/dist/node/include/cppgc/internal/gc-info.h +148 -0
  47. package/dist/node/include/cppgc/internal/logging.h +50 -0
  48. package/dist/node/include/cppgc/internal/member-storage.h +256 -0
  49. package/dist/node/include/cppgc/internal/name-trait.h +137 -0
  50. package/dist/node/include/cppgc/internal/persistent-node.h +214 -0
  51. package/dist/node/include/cppgc/internal/pointer-policies.h +243 -0
  52. package/dist/node/include/cppgc/internal/write-barrier.h +487 -0
  53. package/dist/node/include/cppgc/liveness-broker.h +78 -0
  54. package/dist/node/include/cppgc/macros.h +35 -0
  55. package/dist/node/include/cppgc/member.h +629 -0
  56. package/dist/node/include/cppgc/name-provider.h +65 -0
  57. package/dist/node/include/cppgc/object-size-trait.h +58 -0
  58. package/dist/node/include/cppgc/persistent.h +377 -0
  59. package/dist/node/include/cppgc/platform.h +163 -0
  60. package/dist/node/include/cppgc/prefinalizer.h +75 -0
  61. package/dist/node/include/cppgc/process-heap-statistics.h +36 -0
  62. package/dist/node/include/cppgc/sentinel-pointer.h +39 -0
  63. package/dist/node/include/cppgc/source-location.h +16 -0
  64. package/dist/node/include/cppgc/testing.h +106 -0
  65. package/dist/node/include/cppgc/trace-trait.h +128 -0
  66. package/dist/node/include/cppgc/type-traits.h +271 -0
  67. package/dist/node/include/cppgc/visitor.h +504 -0
  68. package/dist/node/include/crypto/crypto_aes.h +88 -0
  69. package/dist/node/include/crypto/crypto_bio.h +193 -0
  70. package/dist/node/include/crypto/crypto_cipher.h +293 -0
  71. package/dist/node/include/crypto/crypto_clienthello-inl.h +90 -0
  72. package/dist/node/include/crypto/crypto_clienthello.h +131 -0
  73. package/dist/node/include/crypto/crypto_common.h +64 -0
  74. package/dist/node/include/crypto/crypto_context.h +171 -0
  75. package/dist/node/include/crypto/crypto_dh.h +126 -0
  76. package/dist/node/include/crypto/crypto_dsa.h +52 -0
  77. package/dist/node/include/crypto/crypto_ec.h +164 -0
  78. package/dist/node/include/crypto/crypto_hash.h +91 -0
  79. package/dist/node/include/crypto/crypto_hkdf.h +61 -0
  80. package/dist/node/include/crypto/crypto_hmac.h +92 -0
  81. package/dist/node/include/crypto/crypto_keygen.h +299 -0
  82. package/dist/node/include/crypto/crypto_keys.h +392 -0
  83. package/dist/node/include/crypto/crypto_pbkdf2.h +74 -0
  84. package/dist/node/include/crypto/crypto_random.h +124 -0
  85. package/dist/node/include/crypto/crypto_rsa.h +136 -0
  86. package/dist/node/include/crypto/crypto_scrypt.h +85 -0
  87. package/dist/node/include/crypto/crypto_sig.h +165 -0
  88. package/dist/node/include/crypto/crypto_spkac.h +21 -0
  89. package/dist/node/include/crypto/crypto_timing.h +20 -0
  90. package/dist/node/include/crypto/crypto_tls.h +305 -0
  91. package/dist/node/include/crypto/crypto_util.h +725 -0
  92. package/dist/node/include/crypto/crypto_x509.h +140 -0
  93. package/dist/node/include/dataqueue/queue.h +306 -0
  94. package/dist/node/include/debug_utils-inl.h +278 -0
  95. package/dist/node/include/debug_utils.h +196 -0
  96. package/dist/node/include/diagnosticfilename-inl.h +33 -0
  97. package/dist/node/include/embedded_data.h +17 -0
  98. package/dist/node/include/encoding_binding.h +61 -0
  99. package/dist/node/include/env-inl.h +984 -0
  100. package/dist/node/include/env.h +1287 -0
  101. package/dist/node/include/env_properties.h +540 -0
  102. package/dist/node/include/handle_wrap.h +123 -0
  103. package/dist/node/include/histogram-inl.h +107 -0
  104. package/dist/node/include/histogram.h +279 -0
  105. package/dist/node/include/inspector/io_agent.h +30 -0
  106. package/dist/node/include/inspector/main_thread_interface.h +116 -0
  107. package/dist/node/include/inspector/network_agent.h +94 -0
  108. package/dist/node/include/inspector/network_inspector.h +45 -0
  109. package/dist/node/include/inspector/network_requests_buffer.h +195 -0
  110. package/dist/node/include/inspector/network_resource_manager.h +29 -0
  111. package/dist/node/include/inspector/node_json.h +24 -0
  112. package/dist/node/include/inspector/node_string.h +101 -0
  113. package/dist/node/include/inspector/protocol_helper.h +27 -0
  114. package/dist/node/include/inspector/runtime_agent.h +41 -0
  115. package/dist/node/include/inspector/target_agent.h +75 -0
  116. package/dist/node/include/inspector/tracing_agent.h +43 -0
  117. package/dist/node/include/inspector/worker_agent.h +40 -0
  118. package/dist/node/include/inspector/worker_inspector.h +124 -0
  119. package/dist/node/include/inspector_agent.h +165 -0
  120. package/dist/node/include/inspector_io.h +78 -0
  121. package/dist/node/include/inspector_profiler.h +149 -0
  122. package/dist/node/include/inspector_socket.h +60 -0
  123. package/dist/node/include/inspector_socket_server.h +110 -0
  124. package/dist/node/include/js_native_api.h +607 -0
  125. package/dist/node/include/js_native_api_types.h +226 -0
  126. package/dist/node/include/js_native_api_v8.h +485 -0
  127. package/dist/node/include/js_native_api_v8_internals.h +45 -0
  128. package/dist/node/include/js_stream.h +52 -0
  129. package/dist/node/include/json_utils.h +172 -0
  130. package/dist/node/include/large_pages/node_large_page.h +34 -0
  131. package/dist/node/include/libplatform/libplatform-export.h +29 -0
  132. package/dist/node/include/libplatform/libplatform.h +112 -0
  133. package/dist/node/include/libplatform/v8-tracing.h +333 -0
  134. package/dist/node/include/memory_tracker-inl.h +359 -0
  135. package/dist/node/include/memory_tracker.h +289 -0
  136. package/dist/node/include/module_wrap.h +216 -0
  137. package/dist/node/include/node.h +1593 -0
  138. package/dist/node/include/node_api.h +265 -0
  139. package/dist/node/include/node_api_internals.h +48 -0
  140. package/dist/node/include/node_api_types.h +56 -0
  141. package/dist/node/include/node_binding.h +161 -0
  142. package/dist/node/include/node_blob.h +159 -0
  143. package/dist/node/include/node_bob-inl.h +36 -0
  144. package/dist/node/include/node_bob.h +107 -0
  145. package/dist/node/include/node_buffer.h +92 -0
  146. package/dist/node/include/node_builtins.h +220 -0
  147. package/dist/node/include/node_config_file.h +46 -0
  148. package/dist/node/include/node_constants.h +82 -0
  149. package/dist/node/include/node_context_data.h +168 -0
  150. package/dist/node/include/node_contextify.h +204 -0
  151. package/dist/node/include/node_crypto.h +56 -0
  152. package/dist/node/include/node_debug.h +30 -0
  153. package/dist/node/include/node_dir.h +52 -0
  154. package/dist/node/include/node_dotenv.h +45 -0
  155. package/dist/node/include/node_errors.h +380 -0
  156. package/dist/node/include/node_exit_code.h +54 -0
  157. package/dist/node/include/node_external_reference.h +165 -0
  158. package/dist/node/include/node_file-inl.h +406 -0
  159. package/dist/node/include/node_file.h +537 -0
  160. package/dist/node/include/node_http2.h +1177 -0
  161. package/dist/node/include/node_http2_state.h +159 -0
  162. package/dist/node/include/node_http_common-inl.h +202 -0
  163. package/dist/node/include/node_http_common.h +535 -0
  164. package/dist/node/include/node_i18n.h +132 -0
  165. package/dist/node/include/node_internals.h +483 -0
  166. package/dist/node/include/node_main_instance.h +67 -0
  167. package/dist/node/include/node_mem-inl.h +113 -0
  168. package/dist/node/include/node_mem.h +45 -0
  169. package/dist/node/include/node_messaging.h +389 -0
  170. package/dist/node/include/node_metadata.h +164 -0
  171. package/dist/node/include/node_modules.h +91 -0
  172. package/dist/node/include/node_mutex.h +323 -0
  173. package/dist/node/include/node_object_wrap.h +132 -0
  174. package/dist/node/include/node_options-inl.h +490 -0
  175. package/dist/node/include/node_options.h +615 -0
  176. package/dist/node/include/node_perf.h +166 -0
  177. package/dist/node/include/node_perf_common.h +102 -0
  178. package/dist/node/include/node_platform.h +238 -0
  179. package/dist/node/include/node_process-inl.h +26 -0
  180. package/dist/node/include/node_process.h +112 -0
  181. package/dist/node/include/node_realm-inl.h +151 -0
  182. package/dist/node/include/node_realm.h +183 -0
  183. package/dist/node/include/node_report.h +43 -0
  184. package/dist/node/include/node_revert.h +82 -0
  185. package/dist/node/include/node_root_certs.h +3520 -0
  186. package/dist/node/include/node_sea.h +74 -0
  187. package/dist/node/include/node_shadow_realm.h +46 -0
  188. package/dist/node/include/node_snapshot_builder.h +57 -0
  189. package/dist/node/include/node_snapshotable.h +174 -0
  190. package/dist/node/include/node_sockaddr-inl.h +257 -0
  191. package/dist/node/include/node_sockaddr.h +394 -0
  192. package/dist/node/include/node_sqlite.h +270 -0
  193. package/dist/node/include/node_stat_watcher.h +73 -0
  194. package/dist/node/include/node_task_runner.h +92 -0
  195. package/dist/node/include/node_threadsafe_cow-inl.h +54 -0
  196. package/dist/node/include/node_threadsafe_cow.h +105 -0
  197. package/dist/node/include/node_union_bytes.h +81 -0
  198. package/dist/node/include/node_url.h +96 -0
  199. package/dist/node/include/node_v8.h +77 -0
  200. package/dist/node/include/node_v8_platform-inl.h +185 -0
  201. package/dist/node/include/node_version.h +110 -0
  202. package/dist/node/include/node_wasi.h +184 -0
  203. package/dist/node/include/node_wasm_web_api.h +55 -0
  204. package/dist/node/include/node_watchdog.h +154 -0
  205. package/dist/node/include/node_webstorage.h +60 -0
  206. package/dist/node/include/node_worker.h +158 -0
  207. package/dist/node/include/path.h +33 -0
  208. package/dist/node/include/permission/addon_permission.h +31 -0
  209. package/dist/node/include/permission/child_process_permission.h +31 -0
  210. package/dist/node/include/permission/fs_permission.h +167 -0
  211. package/dist/node/include/permission/inspector_permission.h +31 -0
  212. package/dist/node/include/permission/permission.h +138 -0
  213. package/dist/node/include/permission/permission_base.h +65 -0
  214. package/dist/node/include/permission/wasi_permission.h +31 -0
  215. package/dist/node/include/permission/worker_permission.h +31 -0
  216. package/dist/node/include/pipe_wrap.h +80 -0
  217. package/dist/node/include/quic/application.h +159 -0
  218. package/dist/node/include/quic/bindingdata.h +272 -0
  219. package/dist/node/include/quic/cid.h +127 -0
  220. package/dist/node/include/quic/data.h +148 -0
  221. package/dist/node/include/quic/defs.h +245 -0
  222. package/dist/node/include/quic/endpoint.h +458 -0
  223. package/dist/node/include/quic/http3.h +15 -0
  224. package/dist/node/include/quic/logstream.h +81 -0
  225. package/dist/node/include/quic/packet.h +152 -0
  226. package/dist/node/include/quic/preferredaddress.h +72 -0
  227. package/dist/node/include/quic/session.h +443 -0
  228. package/dist/node/include/quic/sessionticket.h +108 -0
  229. package/dist/node/include/quic/streams.h +232 -0
  230. package/dist/node/include/quic/tlscontext.h +227 -0
  231. package/dist/node/include/quic/tokens.h +256 -0
  232. package/dist/node/include/quic/transportparams.h +165 -0
  233. package/dist/node/include/req_wrap-inl.h +171 -0
  234. package/dist/node/include/req_wrap.h +77 -0
  235. package/dist/node/include/spawn_sync.h +243 -0
  236. package/dist/node/include/stream_base-inl.h +173 -0
  237. package/dist/node/include/stream_base.h +478 -0
  238. package/dist/node/include/stream_pipe.h +76 -0
  239. package/dist/node/include/stream_wrap.h +132 -0
  240. package/dist/node/include/string_bytes.h +113 -0
  241. package/dist/node/include/string_decoder-inl.h +31 -0
  242. package/dist/node/include/string_decoder.h +49 -0
  243. package/dist/node/include/tcp_wrap.h +105 -0
  244. package/dist/node/include/threadpoolwork-inl.h +70 -0
  245. package/dist/node/include/timer_wrap-inl.h +32 -0
  246. package/dist/node/include/timer_wrap.h +85 -0
  247. package/dist/node/include/timers.h +70 -0
  248. package/dist/node/include/tracing/agent.h +195 -0
  249. package/dist/node/include/tracing/node_trace_buffer.h +83 -0
  250. package/dist/node/include/tracing/node_trace_writer.h +75 -0
  251. package/dist/node/include/tracing/trace_event.h +722 -0
  252. package/dist/node/include/tracing/trace_event_common.h +1109 -0
  253. package/dist/node/include/tracing/traced_value.h +129 -0
  254. package/dist/node/include/tty_wrap.h +65 -0
  255. package/dist/node/include/udp_wrap.h +230 -0
  256. package/dist/node/include/undici_version.h +6 -0
  257. package/dist/node/include/util-inl.h +700 -0
  258. package/dist/node/include/util.h +1021 -0
  259. package/dist/node/include/uv/aix.h +32 -0
  260. package/dist/node/include/uv/bsd.h +34 -0
  261. package/dist/node/include/uv/darwin.h +61 -0
  262. package/dist/node/include/uv/errno.h +483 -0
  263. package/dist/node/include/uv/linux.h +34 -0
  264. package/dist/node/include/uv/os390.h +33 -0
  265. package/dist/node/include/uv/posix.h +31 -0
  266. package/dist/node/include/uv/sunos.h +44 -0
  267. package/dist/node/include/uv/threadpool.h +37 -0
  268. package/dist/node/include/uv/tree.h +521 -0
  269. package/dist/node/include/uv/unix.h +512 -0
  270. package/dist/node/include/uv/version.h +43 -0
  271. package/dist/node/include/uv/win.h +698 -0
  272. package/dist/node/include/uv.h +1990 -0
  273. package/dist/node/include/v8-array-buffer.h +525 -0
  274. package/dist/node/include/v8-callbacks.h +462 -0
  275. package/dist/node/include/v8-container.h +183 -0
  276. package/dist/node/include/v8-context.h +485 -0
  277. package/dist/node/include/v8-cppgc.h +245 -0
  278. package/dist/node/include/v8-data.h +80 -0
  279. package/dist/node/include/v8-date.h +48 -0
  280. package/dist/node/include/v8-debug.h +168 -0
  281. package/dist/node/include/v8-embedder-heap.h +82 -0
  282. package/dist/node/include/v8-embedder-state-scope.h +52 -0
  283. package/dist/node/include/v8-exception.h +223 -0
  284. package/dist/node/include/v8-extension.h +62 -0
  285. package/dist/node/include/v8-external.h +37 -0
  286. package/dist/node/include/v8-fast-api-calls.h +984 -0
  287. package/dist/node/include/v8-forward.h +82 -0
  288. package/dist/node/include/v8-function-callback.h +607 -0
  289. package/dist/node/include/v8-function.h +140 -0
  290. package/dist/node/include/v8-handle-base.h +137 -0
  291. package/dist/node/include/v8-initialization.h +289 -0
  292. package/dist/node/include/v8-inspector-protocol.h +13 -0
  293. package/dist/node/include/v8-inspector.h +419 -0
  294. package/dist/node/include/v8-internal.h +1397 -0
  295. package/dist/node/include/v8-isolate.h +1767 -0
  296. package/dist/node/include/v8-json.h +47 -0
  297. package/dist/node/include/v8-local-handle.h +758 -0
  298. package/dist/node/include/v8-locker.h +138 -0
  299. package/dist/node/include/v8-maybe.h +160 -0
  300. package/dist/node/include/v8-memory-span.h +198 -0
  301. package/dist/node/include/v8-message.h +233 -0
  302. package/dist/node/include/v8-metrics.h +264 -0
  303. package/dist/node/include/v8-microtask-queue.h +157 -0
  304. package/dist/node/include/v8-microtask.h +28 -0
  305. package/dist/node/include/v8-object.h +824 -0
  306. package/dist/node/include/v8-persistent-handle.h +582 -0
  307. package/dist/node/include/v8-platform.h +1358 -0
  308. package/dist/node/include/v8-primitive-object.h +118 -0
  309. package/dist/node/include/v8-primitive.h +877 -0
  310. package/dist/node/include/v8-profiler.h +1302 -0
  311. package/dist/node/include/v8-promise.h +174 -0
  312. package/dist/node/include/v8-proxy.h +50 -0
  313. package/dist/node/include/v8-regexp.h +106 -0
  314. package/dist/node/include/v8-script.h +904 -0
  315. package/dist/node/include/v8-snapshot.h +266 -0
  316. package/dist/node/include/v8-source-location.h +92 -0
  317. package/dist/node/include/v8-statistics.h +238 -0
  318. package/dist/node/include/v8-template.h +1297 -0
  319. package/dist/node/include/v8-traced-handle.h +432 -0
  320. package/dist/node/include/v8-typed-array.h +390 -0
  321. package/dist/node/include/v8-unwinder-state.h +31 -0
  322. package/dist/node/include/v8-unwinder.h +132 -0
  323. package/dist/node/include/v8-util.h +665 -0
  324. package/dist/node/include/v8-value-serializer-version.h +24 -0
  325. package/dist/node/include/v8-value-serializer.h +316 -0
  326. package/dist/node/include/v8-value.h +655 -0
  327. package/dist/node/include/v8-version-string.h +38 -0
  328. package/dist/node/include/v8-version.h +20 -0
  329. package/dist/node/include/v8-wasm-trap-handler-posix.h +31 -0
  330. package/dist/node/include/v8-wasm-trap-handler-win.h +28 -0
  331. package/dist/node/include/v8-wasm.h +201 -0
  332. package/dist/node/include/v8-weak-callback-info.h +80 -0
  333. package/dist/node/include/v8.h +88 -0
  334. package/dist/node/include/v8config.h +981 -0
  335. package/dist/node/include/zlib_version.h +6 -0
  336. package/dist/node/libnode.dll +0 -0
  337. package/dist/node/libnode.lib +0 -0
  338. package/dist/node/libnodebuildinfo.json +10 -0
  339. package/dist/node/link_node.lib +0 -0
  340. package/dist/node/link_node.node +0 -0
  341. package/index.js +5 -0
  342. package/libnode.release.json +8 -0
  343. package/package.json +29 -1
@@ -0,0 +1,82 @@
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_FORWARD_H_
6
+ #define INCLUDE_V8_FORWARD_H_
7
+
8
+ // This header is intended to be used by headers that pass around V8 types,
9
+ // either by pointer or using Local<Type>. The full definitions can be included
10
+ // either via v8.h or the more fine-grained headers.
11
+
12
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
13
+
14
+ namespace v8 {
15
+
16
+ class AccessorSignature;
17
+ class Array;
18
+ class ArrayBuffer;
19
+ class ArrayBufferView;
20
+ class BigInt;
21
+ class BigInt64Array;
22
+ class BigIntObject;
23
+ class BigUint64Array;
24
+ class Boolean;
25
+ class BooleanObject;
26
+ class Context;
27
+ class DataView;
28
+ class Data;
29
+ class Date;
30
+ class DictionaryTemplate;
31
+ class Extension;
32
+ class External;
33
+ class FixedArray;
34
+ class Float32Array;
35
+ class Float64Array;
36
+ class Function;
37
+ template <class F>
38
+ class FunctionCallbackInfo;
39
+ class FunctionTemplate;
40
+ class Int16Array;
41
+ class Int32;
42
+ class Int32Array;
43
+ class Int8Array;
44
+ class Integer;
45
+ class Isolate;
46
+ class Map;
47
+ class Module;
48
+ class Name;
49
+ class Number;
50
+ class NumberObject;
51
+ class Object;
52
+ class ObjectTemplate;
53
+ class Platform;
54
+ class Primitive;
55
+ class Private;
56
+ class Promise;
57
+ class Proxy;
58
+ class RegExp;
59
+ class Script;
60
+ class Set;
61
+ class SharedArrayBuffer;
62
+ class Signature;
63
+ class String;
64
+ class StringObject;
65
+ class Symbol;
66
+ class SymbolObject;
67
+ class Template;
68
+ class TryCatch;
69
+ class TypedArray;
70
+ class Uint16Array;
71
+ class Uint32;
72
+ class Uint32Array;
73
+ class Uint8Array;
74
+ class Uint8ClampedArray;
75
+ class UnboundModuleScript;
76
+ class Value;
77
+ class WasmMemoryObject;
78
+ class WasmModuleObject;
79
+
80
+ } // namespace v8
81
+
82
+ #endif // INCLUDE_V8_FORWARD_H_
@@ -0,0 +1,607 @@
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_FUNCTION_CALLBACK_H_
6
+ #define INCLUDE_V8_FUNCTION_CALLBACK_H_
7
+
8
+ #include <cstdint>
9
+ #include <limits>
10
+
11
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
12
+ #include "v8-primitive.h" // NOLINT(build/include_directory)
13
+ #include "v8config.h" // NOLINT(build/include_directory)
14
+
15
+ namespace v8 {
16
+
17
+ template <typename T>
18
+ class BasicTracedReference;
19
+ template <typename T>
20
+ class Global;
21
+ class Object;
22
+ class Value;
23
+
24
+ namespace internal {
25
+ class FunctionCallbackArguments;
26
+ class PropertyCallbackArguments;
27
+ class Builtins;
28
+ } // namespace internal
29
+
30
+ namespace debug {
31
+ class ConsoleCallArguments;
32
+ } // namespace debug
33
+
34
+ template <typename T>
35
+ class ReturnValue {
36
+ public:
37
+ template <class S>
38
+ V8_INLINE ReturnValue(const ReturnValue<S>& that) : value_(that.value_) {
39
+ static_assert(std::is_base_of<T, S>::value, "type check");
40
+ }
41
+ // Local setters
42
+ template <typename S>
43
+ V8_INLINE void Set(const Global<S>& handle);
44
+ template <typename S>
45
+ V8_INLINE void SetNonEmpty(const Global<S>& handle);
46
+ template <typename S>
47
+ V8_INLINE void Set(const BasicTracedReference<S>& handle);
48
+ template <typename S>
49
+ V8_INLINE void SetNonEmpty(const BasicTracedReference<S>& handle);
50
+ template <typename S>
51
+ V8_INLINE void Set(const Local<S> handle);
52
+ template <typename S>
53
+ V8_INLINE void SetNonEmpty(const Local<S> handle);
54
+ // Fast primitive setters
55
+ V8_INLINE void Set(bool value);
56
+ V8_INLINE void Set(double i);
57
+ V8_INLINE void Set(int32_t i);
58
+ V8_INLINE void Set(uint32_t i);
59
+ V8_INLINE void Set(uint16_t);
60
+ // Fast JS primitive setters
61
+ V8_INLINE void SetNull();
62
+ V8_INLINE void SetUndefined();
63
+ V8_INLINE void SetEmptyString();
64
+ // Convenience getter for Isolate
65
+ V8_INLINE Isolate* GetIsolate() const;
66
+
67
+ // Pointer setter: Uncompilable to prevent inadvertent misuse.
68
+ template <typename S>
69
+ V8_INLINE void Set(S* whatever);
70
+
71
+ // Getter. Creates a new Local<> so it comes with a certain performance
72
+ // hit. If the ReturnValue was not yet set, this will return the undefined
73
+ // value.
74
+ V8_INLINE Local<Value> Get() const;
75
+
76
+ private:
77
+ template <class F>
78
+ friend class ReturnValue;
79
+ template <class F>
80
+ friend class FunctionCallbackInfo;
81
+ template <class F>
82
+ friend class PropertyCallbackInfo;
83
+ template <class F, class G, class H>
84
+ friend class PersistentValueMapBase;
85
+ V8_INLINE void SetInternal(internal::Address value);
86
+ // Setting the hole value has different meanings depending on the usage:
87
+ // - for function template callbacks it means that the callback returns
88
+ // the undefined value,
89
+ // - for property getter callbacks is means that the callback returns
90
+ // the undefined value (for property setter callbacks the value returned
91
+ // is ignored),
92
+ // - for interceptor callbacks it means that the request was not handled.
93
+ V8_INLINE void SetTheHole();
94
+ V8_INLINE explicit ReturnValue(internal::Address* slot);
95
+
96
+ // See FunctionCallbackInfo.
97
+ static constexpr int kIsolateValueIndex = -2;
98
+
99
+ internal::Address* value_;
100
+ };
101
+
102
+ /**
103
+ * The argument information given to function call callbacks. This
104
+ * class provides access to information about the context of the call,
105
+ * including the receiver, the number and values of arguments, and
106
+ * the holder of the function.
107
+ */
108
+ template <typename T>
109
+ class FunctionCallbackInfo {
110
+ public:
111
+ /** The number of available arguments. */
112
+ V8_INLINE int Length() const;
113
+ /**
114
+ * Accessor for the available arguments. Returns `undefined` if the index
115
+ * is out of bounds.
116
+ */
117
+ V8_INLINE Local<Value> operator[](int i) const;
118
+ /** Returns the receiver. This corresponds to the "this" value. */
119
+ V8_INLINE Local<Object> This() const;
120
+ /**
121
+ * If the callback was created without a Signature, this is the same
122
+ * value as This(). If there is a signature, and the signature didn't match
123
+ * This() but one of its hidden prototypes, this will be the respective
124
+ * hidden prototype.
125
+ *
126
+ * Note that this is not the prototype of This() on which the accessor
127
+ * referencing this callback was found (which in V8 internally is often
128
+ * referred to as holder [sic]).
129
+ */
130
+ V8_INLINE Local<Object> Holder() const;
131
+ /** For construct calls, this returns the "new.target" value. */
132
+ V8_INLINE Local<Value> NewTarget() const;
133
+ /** Indicates whether this is a regular call or a construct call. */
134
+ V8_INLINE bool IsConstructCall() const;
135
+ /** The data argument specified when creating the callback. */
136
+ V8_INLINE Local<Value> Data() const;
137
+ /** The current Isolate. */
138
+ V8_INLINE Isolate* GetIsolate() const;
139
+ /** The ReturnValue for the call. */
140
+ V8_INLINE ReturnValue<T> GetReturnValue() const;
141
+
142
+ private:
143
+ friend class internal::FunctionCallbackArguments;
144
+ friend class internal::CustomArguments<FunctionCallbackInfo>;
145
+ friend class debug::ConsoleCallArguments;
146
+
147
+ static constexpr int kHolderIndex = 0;
148
+ static constexpr int kIsolateIndex = 1;
149
+ static constexpr int kUnusedIndex = 2;
150
+ static constexpr int kReturnValueIndex = 3;
151
+ static constexpr int kDataIndex = 4;
152
+ static constexpr int kNewTargetIndex = 5;
153
+ static constexpr int kArgsLength = 6;
154
+
155
+ static constexpr int kArgsLengthWithReceiver = kArgsLength + 1;
156
+
157
+ // Codegen constants:
158
+ static constexpr int kSize = 3 * internal::kApiSystemPointerSize;
159
+ static constexpr int kImplicitArgsOffset = 0;
160
+ static constexpr int kValuesOffset =
161
+ kImplicitArgsOffset + internal::kApiSystemPointerSize;
162
+ static constexpr int kLengthOffset =
163
+ kValuesOffset + internal::kApiSystemPointerSize;
164
+
165
+ static constexpr int kThisValuesIndex = -1;
166
+ static_assert(ReturnValue<Value>::kIsolateValueIndex ==
167
+ kIsolateIndex - kReturnValueIndex);
168
+
169
+ V8_INLINE FunctionCallbackInfo(internal::Address* implicit_args,
170
+ internal::Address* values, int length);
171
+ internal::Address* implicit_args_;
172
+ internal::Address* values_;
173
+ int length_;
174
+ };
175
+
176
+ /**
177
+ * The information passed to a property callback about the context
178
+ * of the property access.
179
+ */
180
+ template <typename T>
181
+ class PropertyCallbackInfo {
182
+ public:
183
+ /**
184
+ * \return The isolate of the property access.
185
+ */
186
+ V8_INLINE Isolate* GetIsolate() const;
187
+
188
+ /**
189
+ * \return The data set in the configuration, i.e., in
190
+ * `NamedPropertyHandlerConfiguration` or
191
+ * `IndexedPropertyHandlerConfiguration.`
192
+ */
193
+ V8_INLINE Local<Value> Data() const;
194
+
195
+ /**
196
+ * \return The receiver. In many cases, this is the object on which the
197
+ * property access was intercepted. When using
198
+ * `Reflect.get`, `Function.prototype.call`, or similar functions, it is the
199
+ * object passed in as receiver or thisArg.
200
+ *
201
+ * \code
202
+ * void GetterCallback(Local<Name> name,
203
+ * const v8::PropertyCallbackInfo<v8::Value>& info) {
204
+ * auto context = info.GetIsolate()->GetCurrentContext();
205
+ *
206
+ * v8::Local<v8::Value> a_this =
207
+ * info.This()
208
+ * ->GetRealNamedProperty(context, v8_str("a"))
209
+ * .ToLocalChecked();
210
+ * v8::Local<v8::Value> a_holder =
211
+ * info.Holder()
212
+ * ->GetRealNamedProperty(context, v8_str("a"))
213
+ * .ToLocalChecked();
214
+ *
215
+ * CHECK(v8_str("r")->Equals(context, a_this).FromJust());
216
+ * CHECK(v8_str("obj")->Equals(context, a_holder).FromJust());
217
+ *
218
+ * info.GetReturnValue().Set(name);
219
+ * }
220
+ *
221
+ * v8::Local<v8::FunctionTemplate> templ =
222
+ * v8::FunctionTemplate::New(isolate);
223
+ * templ->InstanceTemplate()->SetHandler(
224
+ * v8::NamedPropertyHandlerConfiguration(GetterCallback));
225
+ * LocalContext env;
226
+ * env->Global()
227
+ * ->Set(env.local(), v8_str("obj"), templ->GetFunction(env.local())
228
+ * .ToLocalChecked()
229
+ * ->NewInstance(env.local())
230
+ * .ToLocalChecked())
231
+ * .FromJust();
232
+ *
233
+ * CompileRun("obj.a = 'obj'; var r = {a: 'r'}; Reflect.get(obj, 'x', r)");
234
+ * \endcode
235
+ */
236
+ V8_INLINE Local<Object> This() const;
237
+
238
+ /**
239
+ * \return The object in the prototype chain of the receiver that has the
240
+ * interceptor. Suppose you have `x` and its prototype is `y`, and `y`
241
+ * has an interceptor. Then `info.This()` is `x` and `info.Holder()` is `y`.
242
+ * The Holder() could be a hidden object (the global object, rather
243
+ * than the global proxy).
244
+ *
245
+ * \note For security reasons, do not pass the object back into the runtime.
246
+ */
247
+ V8_INLINE Local<Object> Holder() const;
248
+
249
+ /**
250
+ * \return The return value of the callback.
251
+ * Can be changed by calling Set().
252
+ * \code
253
+ * info.GetReturnValue().Set(...)
254
+ * \endcode
255
+ *
256
+ */
257
+ V8_INLINE ReturnValue<T> GetReturnValue() const;
258
+
259
+ /**
260
+ * \return True if the intercepted function should throw if an error occurs.
261
+ * Usually, `true` corresponds to `'use strict'`.
262
+ *
263
+ * \note Always `false` when intercepting `Reflect.set()`
264
+ * independent of the language mode.
265
+ */
266
+ V8_INLINE bool ShouldThrowOnError() const;
267
+
268
+ private:
269
+ friend class MacroAssembler;
270
+ friend class internal::PropertyCallbackArguments;
271
+ friend class internal::CustomArguments<PropertyCallbackInfo>;
272
+ static constexpr int kShouldThrowOnErrorIndex = 0;
273
+ static constexpr int kHolderIndex = 1;
274
+ static constexpr int kIsolateIndex = 2;
275
+ static constexpr int kUnusedIndex = 3;
276
+ static constexpr int kReturnValueIndex = 4;
277
+ static constexpr int kDataIndex = 5;
278
+ static constexpr int kThisIndex = 6;
279
+ static constexpr int kArgsLength = 7;
280
+
281
+ static constexpr int kSize = 1 * internal::kApiSystemPointerSize;
282
+
283
+ V8_INLINE explicit PropertyCallbackInfo(internal::Address* args)
284
+ : args_(args) {}
285
+
286
+ internal::Address* args_;
287
+ };
288
+
289
+ using FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info);
290
+
291
+ // --- Implementation ---
292
+
293
+ template <typename T>
294
+ ReturnValue<T>::ReturnValue(internal::Address* slot) : value_(slot) {}
295
+
296
+ template <typename T>
297
+ void ReturnValue<T>::SetInternal(internal::Address value) {
298
+ #if V8_STATIC_ROOTS_BOOL
299
+ using I = internal::Internals;
300
+ // Ensure that the upper 32-bits are not modified. Compiler should be
301
+ // able to optimize this to a store of a lower 32-bits of the value.
302
+ // This is fine since the callback can return only JavaScript values which
303
+ // are either Smis or heap objects allocated in the main cage.
304
+ *value_ = I::DecompressTaggedField(*value_, I::CompressTagged(value));
305
+ #else
306
+ *value_ = value;
307
+ #endif // V8_STATIC_ROOTS_BOOL
308
+ }
309
+
310
+ template <typename T>
311
+ template <typename S>
312
+ void ReturnValue<T>::Set(const Global<S>& handle) {
313
+ static_assert(std::is_base_of<T, S>::value, "type check");
314
+ if (V8_UNLIKELY(handle.IsEmpty())) {
315
+ SetTheHole();
316
+ } else {
317
+ SetInternal(handle.ptr());
318
+ }
319
+ }
320
+
321
+ template <typename T>
322
+ template <typename S>
323
+ void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
324
+ static_assert(std::is_base_of<T, S>::value, "type check");
325
+ #ifdef V8_ENABLE_CHECKS
326
+ internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
327
+ #endif // V8_ENABLE_CHECKS
328
+ SetInternal(handle.ptr());
329
+ }
330
+
331
+ template <typename T>
332
+ template <typename S>
333
+ void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
334
+ static_assert(std::is_base_of<T, S>::value, "type check");
335
+ if (V8_UNLIKELY(handle.IsEmpty())) {
336
+ SetTheHole();
337
+ } else {
338
+ SetInternal(handle.ptr());
339
+ }
340
+ }
341
+
342
+ template <typename T>
343
+ template <typename S>
344
+ void ReturnValue<T>::SetNonEmpty(const BasicTracedReference<S>& handle) {
345
+ static_assert(std::is_base_of<T, S>::value, "type check");
346
+ #ifdef V8_ENABLE_CHECKS
347
+ internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
348
+ #endif // V8_ENABLE_CHECKS
349
+ SetInternal(handle.ptr());
350
+ }
351
+
352
+ template <typename T>
353
+ template <typename S>
354
+ void ReturnValue<T>::Set(const Local<S> handle) {
355
+ static_assert(std::is_void<T>::value || std::is_base_of<T, S>::value,
356
+ "type check");
357
+ if (V8_UNLIKELY(handle.IsEmpty())) {
358
+ SetTheHole();
359
+ } else {
360
+ SetInternal(handle.ptr());
361
+ }
362
+ }
363
+
364
+ template <typename T>
365
+ template <typename S>
366
+ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
367
+ static_assert(std::is_void<T>::value || std::is_base_of<T, S>::value,
368
+ "type check");
369
+ #ifdef V8_ENABLE_CHECKS
370
+ internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
371
+ #endif // V8_ENABLE_CHECKS
372
+ SetInternal(handle.ptr());
373
+ }
374
+
375
+ template <typename T>
376
+ void ReturnValue<T>::Set(double i) {
377
+ static_assert(std::is_base_of<T, Number>::value, "type check");
378
+ SetNonEmpty(Number::New(GetIsolate(), i));
379
+ }
380
+
381
+ template <typename T>
382
+ void ReturnValue<T>::Set(int32_t i) {
383
+ static_assert(std::is_base_of<T, Integer>::value, "type check");
384
+ using I = internal::Internals;
385
+ if (V8_LIKELY(I::IsValidSmi(i))) {
386
+ SetInternal(I::IntToSmi(i));
387
+ return;
388
+ }
389
+ SetNonEmpty(Integer::New(GetIsolate(), i));
390
+ }
391
+
392
+ template <typename T>
393
+ void ReturnValue<T>::Set(uint32_t i) {
394
+ static_assert(std::is_base_of<T, Integer>::value, "type check");
395
+ // Can't simply use INT32_MAX here for whatever reason.
396
+ bool fits_into_int32_t = (i & (1U << 31)) == 0;
397
+ if (V8_LIKELY(fits_into_int32_t)) {
398
+ Set(static_cast<int32_t>(i));
399
+ return;
400
+ }
401
+ SetNonEmpty(Integer::NewFromUnsigned(GetIsolate(), i));
402
+ }
403
+
404
+ template <typename T>
405
+ void ReturnValue<T>::Set(uint16_t i) {
406
+ static_assert(std::is_base_of<T, Integer>::value, "type check");
407
+ using I = internal::Internals;
408
+ static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
409
+ static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
410
+ SetInternal(I::IntToSmi(i));
411
+ }
412
+
413
+ template <typename T>
414
+ void ReturnValue<T>::Set(bool value) {
415
+ static_assert(std::is_base_of<T, Boolean>::value, "type check");
416
+ using I = internal::Internals;
417
+ #if V8_STATIC_ROOTS_BOOL
418
+ #ifdef V8_ENABLE_CHECKS
419
+ internal::PerformCastCheck(
420
+ internal::ValueHelper::SlotAsValue<Value, true>(value_));
421
+ #endif // V8_ENABLE_CHECKS
422
+ SetInternal(value ? I::StaticReadOnlyRoot::kTrueValue
423
+ : I::StaticReadOnlyRoot::kFalseValue);
424
+ #else
425
+ int root_index;
426
+ if (value) {
427
+ root_index = I::kTrueValueRootIndex;
428
+ } else {
429
+ root_index = I::kFalseValueRootIndex;
430
+ }
431
+ *value_ = I::GetRoot(GetIsolate(), root_index);
432
+ #endif // V8_STATIC_ROOTS_BOOL
433
+ }
434
+
435
+ template <typename T>
436
+ void ReturnValue<T>::SetTheHole() {
437
+ using I = internal::Internals;
438
+ #if V8_STATIC_ROOTS_BOOL
439
+ SetInternal(I::StaticReadOnlyRoot::kTheHoleValue);
440
+ #else
441
+ *value_ = I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex);
442
+ #endif // V8_STATIC_ROOTS_BOOL
443
+ }
444
+
445
+ template <typename T>
446
+ void ReturnValue<T>::SetNull() {
447
+ static_assert(std::is_base_of<T, Primitive>::value, "type check");
448
+ using I = internal::Internals;
449
+ #if V8_STATIC_ROOTS_BOOL
450
+ #ifdef V8_ENABLE_CHECKS
451
+ internal::PerformCastCheck(
452
+ internal::ValueHelper::SlotAsValue<Value, true>(value_));
453
+ #endif // V8_ENABLE_CHECKS
454
+ SetInternal(I::StaticReadOnlyRoot::kNullValue);
455
+ #else
456
+ *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
457
+ #endif // V8_STATIC_ROOTS_BOOL
458
+ }
459
+
460
+ template <typename T>
461
+ void ReturnValue<T>::SetUndefined() {
462
+ static_assert(std::is_base_of<T, Primitive>::value, "type check");
463
+ using I = internal::Internals;
464
+ #if V8_STATIC_ROOTS_BOOL
465
+ #ifdef V8_ENABLE_CHECKS
466
+ internal::PerformCastCheck(
467
+ internal::ValueHelper::SlotAsValue<Value, true>(value_));
468
+ #endif // V8_ENABLE_CHECKS
469
+ SetInternal(I::StaticReadOnlyRoot::kUndefinedValue);
470
+ #else
471
+ *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
472
+ #endif // V8_STATIC_ROOTS_BOOL
473
+ }
474
+
475
+ template <typename T>
476
+ void ReturnValue<T>::SetEmptyString() {
477
+ static_assert(std::is_base_of<T, String>::value, "type check");
478
+ using I = internal::Internals;
479
+ #if V8_STATIC_ROOTS_BOOL
480
+ #ifdef V8_ENABLE_CHECKS
481
+ internal::PerformCastCheck(
482
+ internal::ValueHelper::SlotAsValue<Value, true>(value_));
483
+ #endif // V8_ENABLE_CHECKS
484
+ SetInternal(I::StaticReadOnlyRoot::kEmptyString);
485
+ #else
486
+ *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
487
+ #endif // V8_STATIC_ROOTS_BOOL
488
+ }
489
+
490
+ template <typename T>
491
+ Isolate* ReturnValue<T>::GetIsolate() const {
492
+ return *reinterpret_cast<Isolate**>(&value_[kIsolateValueIndex]);
493
+ }
494
+
495
+ template <typename T>
496
+ Local<Value> ReturnValue<T>::Get() const {
497
+ using I = internal::Internals;
498
+ #if V8_STATIC_ROOTS_BOOL
499
+ if (I::is_identical(*value_, I::StaticReadOnlyRoot::kTheHoleValue)) {
500
+ #else
501
+ if (*value_ == I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex)) {
502
+ #endif // V8_STATIC_ROOTS_BOOL
503
+ return Undefined(GetIsolate());
504
+ }
505
+ return Local<Value>::New(GetIsolate(),
506
+ internal::ValueHelper::SlotAsValue<Value>(value_));
507
+ }
508
+
509
+ template <typename T>
510
+ template <typename S>
511
+ void ReturnValue<T>::Set(S* whatever) {
512
+ static_assert(sizeof(S) < 0, "incompilable to prevent inadvertent misuse");
513
+ }
514
+
515
+ template <typename T>
516
+ FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Address* implicit_args,
517
+ internal::Address* values,
518
+ int length)
519
+ : implicit_args_(implicit_args), values_(values), length_(length) {}
520
+
521
+ template <typename T>
522
+ Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
523
+ // values_ points to the first argument (not the receiver).
524
+ if (i < 0 || length_ <= i) return Undefined(GetIsolate());
525
+ return Local<Value>::FromSlot(values_ + i);
526
+ }
527
+
528
+ template <typename T>
529
+ Local<Object> FunctionCallbackInfo<T>::This() const {
530
+ // values_ points to the first argument (not the receiver).
531
+ return Local<Object>::FromSlot(values_ + kThisValuesIndex);
532
+ }
533
+
534
+ template <typename T>
535
+ Local<Object> FunctionCallbackInfo<T>::Holder() const {
536
+ return Local<Object>::FromSlot(&implicit_args_[kHolderIndex]);
537
+ }
538
+
539
+ template <typename T>
540
+ Local<Value> FunctionCallbackInfo<T>::NewTarget() const {
541
+ return Local<Value>::FromSlot(&implicit_args_[kNewTargetIndex]);
542
+ }
543
+
544
+ template <typename T>
545
+ Local<Value> FunctionCallbackInfo<T>::Data() const {
546
+ return Local<Value>::FromSlot(&implicit_args_[kDataIndex]);
547
+ }
548
+
549
+ template <typename T>
550
+ Isolate* FunctionCallbackInfo<T>::GetIsolate() const {
551
+ return *reinterpret_cast<Isolate**>(&implicit_args_[kIsolateIndex]);
552
+ }
553
+
554
+ template <typename T>
555
+ ReturnValue<T> FunctionCallbackInfo<T>::GetReturnValue() const {
556
+ return ReturnValue<T>(&implicit_args_[kReturnValueIndex]);
557
+ }
558
+
559
+ template <typename T>
560
+ bool FunctionCallbackInfo<T>::IsConstructCall() const {
561
+ return !NewTarget()->IsUndefined();
562
+ }
563
+
564
+ template <typename T>
565
+ int FunctionCallbackInfo<T>::Length() const {
566
+ return length_;
567
+ }
568
+
569
+ template <typename T>
570
+ Isolate* PropertyCallbackInfo<T>::GetIsolate() const {
571
+ return *reinterpret_cast<Isolate**>(&args_[kIsolateIndex]);
572
+ }
573
+
574
+ template <typename T>
575
+ Local<Value> PropertyCallbackInfo<T>::Data() const {
576
+ return Local<Value>::FromSlot(&args_[kDataIndex]);
577
+ }
578
+
579
+ template <typename T>
580
+ Local<Object> PropertyCallbackInfo<T>::This() const {
581
+ return Local<Object>::FromSlot(&args_[kThisIndex]);
582
+ }
583
+
584
+ template <typename T>
585
+ Local<Object> PropertyCallbackInfo<T>::Holder() const {
586
+ return Local<Object>::FromSlot(&args_[kHolderIndex]);
587
+ }
588
+
589
+ template <typename T>
590
+ ReturnValue<T> PropertyCallbackInfo<T>::GetReturnValue() const {
591
+ return ReturnValue<T>(&args_[kReturnValueIndex]);
592
+ }
593
+
594
+ template <typename T>
595
+ bool PropertyCallbackInfo<T>::ShouldThrowOnError() const {
596
+ using I = internal::Internals;
597
+ if (args_[kShouldThrowOnErrorIndex] !=
598
+ I::IntToSmi(I::kInferShouldThrowMode)) {
599
+ return args_[kShouldThrowOnErrorIndex] != I::IntToSmi(I::kDontThrow);
600
+ }
601
+ return v8::internal::ShouldThrowOnError(
602
+ reinterpret_cast<v8::internal::Isolate*>(GetIsolate()));
603
+ }
604
+
605
+ } // namespace v8
606
+
607
+ #endif // INCLUDE_V8_FUNCTION_CALLBACK_H_