@encharm/cws 4.3.0 → 4.4.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 (238) hide show
  1. package/README.md +5 -7
  2. package/dist/bindings/cws_darwin_arm64_node108.node +0 -0
  3. package/dist/bindings/cws_darwin_arm64_node115.node +0 -0
  4. package/dist/bindings/cws_darwin_arm64_node83.node +0 -0
  5. package/dist/bindings/cws_darwin_arm64_node93.node +0 -0
  6. package/dist/bindings/cws_darwin_x64_node108.node +0 -0
  7. package/dist/bindings/cws_darwin_x64_node115.node +0 -0
  8. package/dist/bindings/cws_darwin_x64_node83.node +0 -0
  9. package/dist/bindings/cws_darwin_x64_node93.node +0 -0
  10. package/dist/bindings/cws_linux_arm64_node108.node +0 -0
  11. package/dist/bindings/cws_linux_arm64_node115.node +0 -0
  12. package/dist/bindings/cws_linux_arm64_node83.node +0 -0
  13. package/dist/bindings/cws_linux_arm64_node93.node +0 -0
  14. package/dist/bindings/cws_linux_x64_node108.node +0 -0
  15. package/dist/bindings/cws_linux_x64_node115.node +0 -0
  16. package/dist/bindings/cws_linux_x64_node83.node +0 -0
  17. package/dist/bindings/cws_linux_x64_node93.node +0 -0
  18. package/dist/bindings/cws_win32_x64_node108.node +0 -0
  19. package/dist/bindings/cws_win32_x64_node115.node +0 -0
  20. package/dist/bindings/cws_win32_x64_node83.node +0 -0
  21. package/dist/bindings/cws_win32_x64_node93.node +0 -0
  22. package/dist/shared.js +1 -1
  23. package/package.json +5 -5
  24. package/src/Addon.cpp +4 -12
  25. package/src/Addon.h +67 -91
  26. package/src/Socket.h +1 -0
  27. package/src/cSNode.cpp +3 -8
  28. package/src/headers/20/acorn_version.h +6 -0
  29. package/src/headers/20/aliased_buffer-inl.h +243 -0
  30. package/src/headers/20/aliased_buffer.h +206 -0
  31. package/src/headers/20/aliased_struct-inl.h +54 -0
  32. package/src/headers/20/aliased_struct.h +63 -0
  33. package/src/headers/20/async_wrap-inl.h +93 -0
  34. package/src/headers/20/async_wrap.h +252 -0
  35. package/src/headers/20/base64-inl.h +193 -0
  36. package/src/headers/20/base64.h +53 -0
  37. package/src/headers/20/base64_version.h +6 -0
  38. package/src/headers/20/base_object-inl.h +316 -0
  39. package/src/headers/20/base_object.h +320 -0
  40. package/src/headers/20/base_object_types.h +73 -0
  41. package/src/headers/20/blob_serializer_deserializer-inl.h +361 -0
  42. package/src/headers/20/blob_serializer_deserializer.h +132 -0
  43. package/src/headers/20/callback_queue-inl.h +97 -0
  44. package/src/headers/20/callback_queue.h +79 -0
  45. package/src/headers/20/cares_wrap.h +524 -0
  46. package/src/headers/20/cjs_module_lexer_version.h +6 -0
  47. package/src/headers/20/cleanup_queue-inl.h +62 -0
  48. package/src/headers/20/cleanup_queue.h +85 -0
  49. package/src/headers/20/connect_wrap.h +26 -0
  50. package/src/headers/20/connection_wrap.h +30 -0
  51. package/src/headers/20/cppgc/DEPS +8 -0
  52. package/src/headers/20/cppgc/OWNERS +2 -0
  53. package/src/headers/20/cppgc/README.md +135 -0
  54. package/src/headers/20/cppgc/allocation.h +310 -0
  55. package/src/headers/20/cppgc/common.h +28 -0
  56. package/src/headers/20/cppgc/cross-thread-persistent.h +466 -0
  57. package/src/headers/20/cppgc/custom-space.h +97 -0
  58. package/src/headers/20/cppgc/default-platform.h +67 -0
  59. package/src/headers/20/cppgc/ephemeron-pair.h +30 -0
  60. package/src/headers/20/cppgc/explicit-management.h +100 -0
  61. package/src/headers/20/cppgc/garbage-collected.h +106 -0
  62. package/src/headers/20/cppgc/heap-consistency.h +309 -0
  63. package/src/headers/20/cppgc/heap-handle.h +48 -0
  64. package/src/headers/20/cppgc/heap-state.h +82 -0
  65. package/src/headers/20/cppgc/heap-statistics.h +120 -0
  66. package/src/headers/20/cppgc/heap.h +202 -0
  67. package/src/headers/20/cppgc/internal/api-constants.h +68 -0
  68. package/src/headers/20/cppgc/internal/atomic-entry-flag.h +48 -0
  69. package/src/headers/20/cppgc/internal/base-page-handle.h +45 -0
  70. package/src/headers/20/cppgc/internal/caged-heap-local-data.h +111 -0
  71. package/src/headers/20/cppgc/internal/caged-heap.h +61 -0
  72. package/src/headers/20/cppgc/internal/compiler-specific.h +38 -0
  73. package/src/headers/20/cppgc/internal/finalizer-trait.h +93 -0
  74. package/src/headers/20/cppgc/internal/gc-info.h +157 -0
  75. package/src/headers/20/cppgc/internal/logging.h +50 -0
  76. package/src/headers/20/cppgc/internal/member-storage.h +248 -0
  77. package/src/headers/20/cppgc/internal/name-trait.h +137 -0
  78. package/src/headers/20/cppgc/internal/persistent-node.h +214 -0
  79. package/src/headers/20/cppgc/internal/pointer-policies.h +243 -0
  80. package/src/headers/20/cppgc/internal/write-barrier.h +487 -0
  81. package/src/headers/20/cppgc/liveness-broker.h +78 -0
  82. package/src/headers/20/cppgc/macros.h +35 -0
  83. package/src/headers/20/cppgc/member.h +604 -0
  84. package/src/headers/20/cppgc/name-provider.h +65 -0
  85. package/src/headers/20/cppgc/object-size-trait.h +58 -0
  86. package/src/headers/20/cppgc/persistent.h +373 -0
  87. package/src/headers/20/cppgc/platform.h +158 -0
  88. package/src/headers/20/cppgc/prefinalizer.h +75 -0
  89. package/src/headers/20/cppgc/process-heap-statistics.h +36 -0
  90. package/src/headers/20/cppgc/sentinel-pointer.h +32 -0
  91. package/src/headers/20/cppgc/source-location.h +92 -0
  92. package/src/headers/20/cppgc/testing.h +106 -0
  93. package/src/headers/20/cppgc/trace-trait.h +120 -0
  94. package/src/headers/20/cppgc/type-traits.h +250 -0
  95. package/src/headers/20/cppgc/visitor.h +426 -0
  96. package/src/headers/20/crypto/crypto_clienthello.h +131 -0
  97. package/src/headers/20/crypto/crypto_context.h +160 -0
  98. package/src/headers/20/crypto/crypto_keys.h +419 -0
  99. package/src/headers/20/crypto/crypto_tls.h +304 -0
  100. package/src/headers/20/crypto/crypto_util.h +806 -0
  101. package/src/headers/20/crypto_clienthello.h +131 -0
  102. package/src/headers/20/debug_utils-inl.h +226 -0
  103. package/src/headers/20/debug_utils.h +188 -0
  104. package/src/headers/20/diagnosticfilename-inl.h +33 -0
  105. package/src/headers/20/encoding_binding.h +59 -0
  106. package/src/headers/20/env-inl.h +923 -0
  107. package/src/headers/20/env.h +1193 -0
  108. package/src/headers/20/env_properties.h +446 -0
  109. package/src/headers/20/handle_wrap.h +123 -0
  110. package/src/headers/20/histogram-inl.h +107 -0
  111. package/src/headers/20/histogram.h +240 -0
  112. package/src/headers/20/inspector_agent.h +144 -0
  113. package/src/headers/20/inspector_io.h +78 -0
  114. package/src/headers/20/inspector_profiler.h +149 -0
  115. package/src/headers/20/inspector_socket.h +60 -0
  116. package/src/headers/20/inspector_socket_server.h +110 -0
  117. package/src/headers/20/js_native_api.h +601 -0
  118. package/src/headers/20/js_native_api_types.h +168 -0
  119. package/src/headers/20/js_native_api_v8.h +463 -0
  120. package/src/headers/20/js_native_api_v8_internals.h +45 -0
  121. package/src/headers/20/js_stream.h +52 -0
  122. package/src/headers/20/json_parser.h +38 -0
  123. package/src/headers/20/json_utils.h +172 -0
  124. package/src/headers/20/memory_tracker-inl.h +356 -0
  125. package/src/headers/20/memory_tracker.h +289 -0
  126. package/src/headers/20/module_wrap.h +117 -0
  127. package/src/headers/20/node.h +1516 -0
  128. package/src/headers/20/node_api.h +261 -0
  129. package/src/headers/20/node_api_internals.h +42 -0
  130. package/src/headers/20/node_api_types.h +52 -0
  131. package/src/headers/20/node_binding.h +142 -0
  132. package/src/headers/20/node_blob.h +159 -0
  133. package/src/headers/20/node_bob-inl.h +36 -0
  134. package/src/headers/20/node_bob.h +107 -0
  135. package/src/headers/20/node_buffer.h +92 -0
  136. package/src/headers/20/node_builtins.h +197 -0
  137. package/src/headers/20/node_constants.h +82 -0
  138. package/src/headers/20/node_context_data.h +98 -0
  139. package/src/headers/20/node_contextify.h +206 -0
  140. package/src/headers/20/node_crypto.h +56 -0
  141. package/src/headers/20/node_dir.h +52 -0
  142. package/src/headers/20/node_dotenv.h +37 -0
  143. package/src/headers/20/node_errors.h +313 -0
  144. package/src/headers/20/node_exit_code.h +54 -0
  145. package/src/headers/20/node_external_reference.h +172 -0
  146. package/src/headers/20/node_file-inl.h +389 -0
  147. package/src/headers/20/node_file.h +537 -0
  148. package/src/headers/20/node_http2.h +1146 -0
  149. package/src/headers/20/node_http2_state.h +147 -0
  150. package/src/headers/20/node_http_common-inl.h +201 -0
  151. package/src/headers/20/node_http_common.h +532 -0
  152. package/src/headers/20/node_i18n.h +145 -0
  153. package/src/headers/20/node_internals.h +443 -0
  154. package/src/headers/20/node_main_instance.h +67 -0
  155. package/src/headers/20/node_mem-inl.h +112 -0
  156. package/src/headers/20/node_mem.h +45 -0
  157. package/src/headers/20/node_messaging.h +377 -0
  158. package/src/headers/20/node_metadata.h +138 -0
  159. package/src/headers/20/node_mutex.h +323 -0
  160. package/src/headers/20/node_object_wrap.h +132 -0
  161. package/src/headers/20/node_options-inl.h +478 -0
  162. package/src/headers/20/node_options.h +538 -0
  163. package/src/headers/20/node_perf.h +166 -0
  164. package/src/headers/20/node_perf_common.h +98 -0
  165. package/src/headers/20/node_platform.h +195 -0
  166. package/src/headers/20/node_process-inl.h +26 -0
  167. package/src/headers/20/node_process.h +99 -0
  168. package/src/headers/20/node_realm-inl.h +139 -0
  169. package/src/headers/20/node_realm.h +184 -0
  170. package/src/headers/20/node_report.h +42 -0
  171. package/src/headers/20/node_revert.h +82 -0
  172. package/src/headers/20/node_root_certs.h +3443 -0
  173. package/src/headers/20/node_sea.h +56 -0
  174. package/src/headers/20/node_shadow_realm.h +46 -0
  175. package/src/headers/20/node_snapshot_builder.h +54 -0
  176. package/src/headers/20/node_snapshotable.h +164 -0
  177. package/src/headers/20/node_sockaddr-inl.h +266 -0
  178. package/src/headers/20/node_sockaddr.h +405 -0
  179. package/src/headers/20/node_stat_watcher.h +73 -0
  180. package/src/headers/20/node_threadsafe_cow-inl.h +54 -0
  181. package/src/headers/20/node_threadsafe_cow.h +105 -0
  182. package/src/headers/20/node_union_bytes.h +81 -0
  183. package/src/headers/20/node_url.h +92 -0
  184. package/src/headers/20/node_v8.h +77 -0
  185. package/src/headers/20/node_v8_platform-inl.h +205 -0
  186. package/src/headers/20/node_version.h +109 -0
  187. package/src/headers/20/node_wasi.h +184 -0
  188. package/src/headers/20/node_wasm_web_api.h +55 -0
  189. package/src/headers/20/node_watchdog.h +154 -0
  190. package/src/headers/20/node_worker.h +151 -0
  191. package/src/headers/20/permission/child_process_permission.h +29 -0
  192. package/src/headers/20/permission/fs_permission.h +154 -0
  193. package/src/headers/20/permission/inspector_permission.h +29 -0
  194. package/src/headers/20/permission/permission.h +74 -0
  195. package/src/headers/20/permission/permission_base.h +53 -0
  196. package/src/headers/20/permission/worker_permission.h +29 -0
  197. package/src/headers/20/pipe_wrap.h +80 -0
  198. package/src/headers/20/req_wrap-inl.h +171 -0
  199. package/src/headers/20/req_wrap.h +77 -0
  200. package/src/headers/20/spawn_sync.h +242 -0
  201. package/src/headers/20/stream_base-inl.h +173 -0
  202. package/src/headers/20/stream_base.h +469 -0
  203. package/src/headers/20/stream_pipe.h +76 -0
  204. package/src/headers/20/stream_wrap.h +131 -0
  205. package/src/headers/20/string_bytes.h +120 -0
  206. package/src/headers/20/string_decoder-inl.h +37 -0
  207. package/src/headers/20/string_decoder.h +50 -0
  208. package/src/headers/20/string_search.h +638 -0
  209. package/src/headers/20/tcp_wrap.h +105 -0
  210. package/src/headers/20/threadpoolwork-inl.h +70 -0
  211. package/src/headers/20/timer_wrap-inl.h +32 -0
  212. package/src/headers/20/timer_wrap.h +85 -0
  213. package/src/headers/20/timers.h +70 -0
  214. package/src/headers/20/tracing/agent.h +195 -0
  215. package/src/headers/20/tracing/node_trace_buffer.h +83 -0
  216. package/src/headers/20/tracing/node_trace_writer.h +75 -0
  217. package/src/headers/20/tracing/trace_event.h +720 -0
  218. package/src/headers/20/tracing/trace_event_common.h +1109 -0
  219. package/src/headers/20/tracing/traced_value.h +70 -0
  220. package/src/headers/20/tty_wrap.h +65 -0
  221. package/src/headers/20/udp_wrap.h +227 -0
  222. package/src/headers/20/undici_version.h +6 -0
  223. package/src/headers/20/util-inl.h +623 -0
  224. package/src/headers/20/util.h +988 -0
  225. package/src/headers/20/v8-cppgc.h +245 -0
  226. package/src/headers/20/v8-fast-api-calls.h +957 -0
  227. package/dist/bindings/cws_darwin_arm64_node64.node +0 -0
  228. package/dist/bindings/cws_darwin_arm64_node72.node +0 -0
  229. package/dist/bindings/cws_darwin_arm64_node79.node +0 -0
  230. package/dist/bindings/cws_darwin_x64_node64.node +0 -0
  231. package/dist/bindings/cws_darwin_x64_node72.node +0 -0
  232. package/dist/bindings/cws_darwin_x64_node79.node +0 -0
  233. package/dist/bindings/cws_linux_x64_node64.node +0 -0
  234. package/dist/bindings/cws_linux_x64_node72.node +0 -0
  235. package/dist/bindings/cws_linux_x64_node79.node +0 -0
  236. package/dist/bindings/cws_win32_x64_node64.node +0 -0
  237. package/dist/bindings/cws_win32_x64_node72.node +0 -0
  238. package/dist/bindings/cws_win32_x64_node79.node +0 -0
@@ -0,0 +1,446 @@
1
+ #ifndef SRC_ENV_PROPERTIES_H_
2
+ #define SRC_ENV_PROPERTIES_H_
3
+
4
+ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
+
6
+ // PER_ISOLATE_* macros: We have a lot of per-isolate properties
7
+ // and adding and maintaining their getters and setters by hand would be
8
+ // difficult so let's make the preprocessor generate them for us.
9
+ //
10
+ // In each macro, `V` is expected to be the name of a macro or function which
11
+ // accepts the number of arguments provided in each tuple in the macro body,
12
+ // typically two. The named function will be invoked against each tuple.
13
+ //
14
+ // Make sure that any macro V defined for use with the PER_ISOLATE_* macros is
15
+ // undefined again after use.
16
+
17
+ // Private symbols are per-isolate primitives but Environment proxies them
18
+ // for the sake of convenience. Strings should be ASCII-only and have a
19
+ // "node:" prefix to avoid name clashes with third-party code.
20
+ #define PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) \
21
+ V(arrow_message_private_symbol, "node:arrowMessage") \
22
+ V(contextify_context_private_symbol, "node:contextify:context") \
23
+ V(decorated_private_symbol, "node:decorated") \
24
+ V(host_defined_option_symbol, "node:host_defined_option_symbol") \
25
+ V(napi_type_tag, "node:napi:type_tag") \
26
+ V(napi_wrapper, "node:napi:wrapper") \
27
+ V(untransferable_object_private_symbol, "node:untransferableObject") \
28
+ V(exit_info_private_symbol, "node:exit_info_private_symbol") \
29
+ V(require_private_symbol, "node:require_private_symbol")
30
+
31
+ // Symbols are per-isolate primitives but Environment proxies them
32
+ // for the sake of convenience.
33
+ #define PER_ISOLATE_SYMBOL_PROPERTIES(V) \
34
+ V(default_host_defined_options, "default_host_defined_options") \
35
+ V(fs_use_promises_symbol, "fs_use_promises_symbol") \
36
+ V(async_id_symbol, "async_id_symbol") \
37
+ V(handle_onclose_symbol, "handle_onclose") \
38
+ V(no_message_symbol, "no_message_symbol") \
39
+ V(messaging_deserialize_symbol, "messaging_deserialize_symbol") \
40
+ V(messaging_transfer_symbol, "messaging_transfer_symbol") \
41
+ V(messaging_clone_symbol, "messaging_clone_symbol") \
42
+ V(messaging_transfer_list_symbol, "messaging_transfer_list_symbol") \
43
+ V(oninit_symbol, "oninit") \
44
+ V(owner_symbol, "owner_symbol") \
45
+ V(onpskexchange_symbol, "onpskexchange") \
46
+ V(resource_symbol, "resource_symbol") \
47
+ V(trigger_async_id_symbol, "trigger_async_id_symbol") \
48
+ V(vm_dynamic_import_missing_flag, "vm_dynamic_import_missing_flag")
49
+
50
+ // Strings are per-isolate primitives but Environment proxies them
51
+ // for the sake of convenience. Strings should be ASCII-only.
52
+ #define PER_ISOLATE_STRING_PROPERTIES(V) \
53
+ V(ack_string, "ack") \
54
+ V(address_string, "address") \
55
+ V(aliases_string, "aliases") \
56
+ V(alpn_callback_string, "ALPNCallback") \
57
+ V(args_string, "args") \
58
+ V(asn1curve_string, "asn1Curve") \
59
+ V(async_ids_stack_string, "async_ids_stack") \
60
+ V(base_string, "base") \
61
+ V(bits_string, "bits") \
62
+ V(block_list_string, "blockList") \
63
+ V(buffer_string, "buffer") \
64
+ V(bytes_parsed_string, "bytesParsed") \
65
+ V(bytes_read_string, "bytesRead") \
66
+ V(bytes_written_string, "bytesWritten") \
67
+ V(ca_string, "ca") \
68
+ V(cached_data_produced_string, "cachedDataProduced") \
69
+ V(cached_data_rejected_string, "cachedDataRejected") \
70
+ V(cached_data_string, "cachedData") \
71
+ V(cache_key_string, "cacheKey") \
72
+ V(change_string, "change") \
73
+ V(channel_string, "channel") \
74
+ V(chunks_sent_since_last_write_string, "chunksSentSinceLastWrite") \
75
+ V(clone_unsupported_type_str, "Cannot transfer object of unsupported type.") \
76
+ V(code_string, "code") \
77
+ V(commonjs_string, "commonjs") \
78
+ V(config_string, "config") \
79
+ V(constants_string, "constants") \
80
+ V(crypto_dh_string, "dh") \
81
+ V(crypto_dsa_string, "dsa") \
82
+ V(crypto_ec_string, "ec") \
83
+ V(crypto_ed25519_string, "ed25519") \
84
+ V(crypto_ed448_string, "ed448") \
85
+ V(crypto_x25519_string, "x25519") \
86
+ V(crypto_x448_string, "x448") \
87
+ V(crypto_rsa_string, "rsa") \
88
+ V(crypto_rsa_pss_string, "rsa-pss") \
89
+ V(cwd_string, "cwd") \
90
+ V(data_string, "data") \
91
+ V(default_is_true_string, "defaultIsTrue") \
92
+ V(deserialize_info_string, "deserializeInfo") \
93
+ V(dest_string, "dest") \
94
+ V(destroyed_string, "destroyed") \
95
+ V(detached_string, "detached") \
96
+ V(dh_string, "DH") \
97
+ V(divisor_length_string, "divisorLength") \
98
+ V(dns_a_string, "A") \
99
+ V(dns_aaaa_string, "AAAA") \
100
+ V(dns_caa_string, "CAA") \
101
+ V(dns_critical_string, "critical") \
102
+ V(dns_cname_string, "CNAME") \
103
+ V(dns_mx_string, "MX") \
104
+ V(dns_naptr_string, "NAPTR") \
105
+ V(dns_ns_string, "NS") \
106
+ V(dns_ptr_string, "PTR") \
107
+ V(dns_soa_string, "SOA") \
108
+ V(dns_srv_string, "SRV") \
109
+ V(dns_txt_string, "TXT") \
110
+ V(done_string, "done") \
111
+ V(duration_string, "duration") \
112
+ V(ecdh_string, "ECDH") \
113
+ V(emit_string, "emit") \
114
+ V(emit_warning_string, "emitWarning") \
115
+ V(empty_object_string, "{}") \
116
+ V(encoding_string, "encoding") \
117
+ V(entries_string, "entries") \
118
+ V(entry_type_string, "entryType") \
119
+ V(env_pairs_string, "envPairs") \
120
+ V(env_var_settings_string, "envVarSettings") \
121
+ V(errno_string, "errno") \
122
+ V(error_string, "error") \
123
+ V(exchange_string, "exchange") \
124
+ V(expire_string, "expire") \
125
+ V(exponent_string, "exponent") \
126
+ V(exports_string, "exports") \
127
+ V(ext_key_usage_string, "ext_key_usage") \
128
+ V(external_stream_string, "_externalStream") \
129
+ V(family_string, "family") \
130
+ V(fatal_exception_string, "_fatalException") \
131
+ V(fd_string, "fd") \
132
+ V(fields_string, "fields") \
133
+ V(file_string, "file") \
134
+ V(filename_string, "filename") \
135
+ V(fingerprint256_string, "fingerprint256") \
136
+ V(fingerprint512_string, "fingerprint512") \
137
+ V(fingerprint_string, "fingerprint") \
138
+ V(flags_string, "flags") \
139
+ V(flowlabel_string, "flowlabel") \
140
+ V(fragment_string, "fragment") \
141
+ V(frames_received_string, "framesReceived") \
142
+ V(frames_sent_string, "framesSent") \
143
+ V(function_string, "function") \
144
+ V(get_string, "get") \
145
+ V(get_data_clone_error_string, "_getDataCloneError") \
146
+ V(get_shared_array_buffer_id_string, "_getSharedArrayBufferId") \
147
+ V(gid_string, "gid") \
148
+ V(h2_string, "h2") \
149
+ V(handle_string, "handle") \
150
+ V(hash_algorithm_string, "hashAlgorithm") \
151
+ V(help_text_string, "helpText") \
152
+ V(homedir_string, "homedir") \
153
+ V(host_string, "host") \
154
+ V(hostmaster_string, "hostmaster") \
155
+ V(http_1_1_string, "http/1.1") \
156
+ V(id_string, "id") \
157
+ V(identity_string, "identity") \
158
+ V(ignore_string, "ignore") \
159
+ V(infoaccess_string, "infoAccess") \
160
+ V(inherit_string, "inherit") \
161
+ V(input_string, "input") \
162
+ V(internal_binding_string, "internalBinding") \
163
+ V(internal_string, "internal") \
164
+ V(ipv4_string, "IPv4") \
165
+ V(ipv6_string, "IPv6") \
166
+ V(isclosing_string, "isClosing") \
167
+ V(issuer_string, "issuer") \
168
+ V(issuercert_string, "issuerCertificate") \
169
+ V(jwk_crv_string, "crv") \
170
+ V(jwk_d_string, "d") \
171
+ V(jwk_dp_string, "dp") \
172
+ V(jwk_dq_string, "dq") \
173
+ V(jwk_dsa_string, "DSA") \
174
+ V(jwk_e_string, "e") \
175
+ V(jwk_ec_string, "EC") \
176
+ V(jwk_g_string, "g") \
177
+ V(jwk_k_string, "k") \
178
+ V(jwk_p_string, "p") \
179
+ V(jwk_q_string, "q") \
180
+ V(jwk_qi_string, "qi") \
181
+ V(jwk_kty_string, "kty") \
182
+ V(jwk_n_string, "n") \
183
+ V(jwk_oct_string, "oct") \
184
+ V(jwk_okp_string, "OKP") \
185
+ V(jwk_rsa_string, "RSA") \
186
+ V(jwk_x_string, "x") \
187
+ V(jwk_y_string, "y") \
188
+ V(kill_signal_string, "killSignal") \
189
+ V(kind_string, "kind") \
190
+ V(length_string, "length") \
191
+ V(library_string, "library") \
192
+ V(mac_string, "mac") \
193
+ V(max_buffer_string, "maxBuffer") \
194
+ V(max_concurrent_streams_string, "maxConcurrentStreams") \
195
+ V(message_port_constructor_string, "MessagePort") \
196
+ V(message_port_string, "messagePort") \
197
+ V(message_string, "message") \
198
+ V(messageerror_string, "messageerror") \
199
+ V(mgf1_hash_algorithm_string, "mgf1HashAlgorithm") \
200
+ V(minttl_string, "minttl") \
201
+ V(module_string, "module") \
202
+ V(modulus_string, "modulus") \
203
+ V(modulus_length_string, "modulusLength") \
204
+ V(name_string, "name") \
205
+ V(named_curve_string, "namedCurve") \
206
+ V(netmask_string, "netmask") \
207
+ V(next_string, "next") \
208
+ V(nistcurve_string, "nistCurve") \
209
+ V(node_string, "node") \
210
+ V(nsname_string, "nsname") \
211
+ V(object_string, "Object") \
212
+ V(ocsp_request_string, "OCSPRequest") \
213
+ V(oncertcb_string, "oncertcb") \
214
+ V(onchange_string, "onchange") \
215
+ V(onclienthello_string, "onclienthello") \
216
+ V(oncomplete_string, "oncomplete") \
217
+ V(onconnection_string, "onconnection") \
218
+ V(ondone_string, "ondone") \
219
+ V(onerror_string, "onerror") \
220
+ V(onexit_string, "onexit") \
221
+ V(onhandshakedone_string, "onhandshakedone") \
222
+ V(onhandshakestart_string, "onhandshakestart") \
223
+ V(onkeylog_string, "onkeylog") \
224
+ V(onmessage_string, "onmessage") \
225
+ V(onnewsession_string, "onnewsession") \
226
+ V(onocspresponse_string, "onocspresponse") \
227
+ V(onreadstart_string, "onreadstart") \
228
+ V(onreadstop_string, "onreadstop") \
229
+ V(onshutdown_string, "onshutdown") \
230
+ V(onsignal_string, "onsignal") \
231
+ V(onunpipe_string, "onunpipe") \
232
+ V(onwrite_string, "onwrite") \
233
+ V(openssl_error_stack, "opensslErrorStack") \
234
+ V(options_string, "options") \
235
+ V(order_string, "order") \
236
+ V(output_string, "output") \
237
+ V(overlapped_string, "overlapped") \
238
+ V(parse_error_string, "Parse Error") \
239
+ V(password_string, "password") \
240
+ V(path_string, "path") \
241
+ V(pending_handle_string, "pendingHandle") \
242
+ V(permission_string, "permission") \
243
+ V(pid_string, "pid") \
244
+ V(ping_rtt_string, "pingRTT") \
245
+ V(pipe_source_string, "pipeSource") \
246
+ V(pipe_string, "pipe") \
247
+ V(pipe_target_string, "pipeTarget") \
248
+ V(port1_string, "port1") \
249
+ V(port2_string, "port2") \
250
+ V(port_string, "port") \
251
+ V(preference_string, "preference") \
252
+ V(primordials_string, "primordials") \
253
+ V(priority_string, "priority") \
254
+ V(process_string, "process") \
255
+ V(promise_string, "promise") \
256
+ V(psk_string, "psk") \
257
+ V(pubkey_string, "pubkey") \
258
+ V(public_exponent_string, "publicExponent") \
259
+ V(query_string, "query") \
260
+ V(rate_string, "rate") \
261
+ V(raw_string, "raw") \
262
+ V(read_host_object_string, "_readHostObject") \
263
+ V(readable_string, "readable") \
264
+ V(reason_string, "reason") \
265
+ V(refresh_string, "refresh") \
266
+ V(regexp_string, "regexp") \
267
+ V(rename_string, "rename") \
268
+ V(replacement_string, "replacement") \
269
+ V(require_string, "require") \
270
+ V(resource_string, "resource") \
271
+ V(retry_string, "retry") \
272
+ V(salt_length_string, "saltLength") \
273
+ V(scheme_string, "scheme") \
274
+ V(scopeid_string, "scopeid") \
275
+ V(serial_number_string, "serialNumber") \
276
+ V(serial_string, "serial") \
277
+ V(servername_string, "servername") \
278
+ V(service_string, "service") \
279
+ V(session_id_string, "sessionId") \
280
+ V(set_string, "set") \
281
+ V(shell_string, "shell") \
282
+ V(signal_string, "signal") \
283
+ V(sink_string, "sink") \
284
+ V(size_string, "size") \
285
+ V(sni_context_err_string, "Invalid SNI context") \
286
+ V(sni_context_string, "sni_context") \
287
+ V(source_string, "source") \
288
+ V(source_map_url_string, "sourceMapURL") \
289
+ V(stack_string, "stack") \
290
+ V(standard_name_string, "standardName") \
291
+ V(start_time_string, "startTime") \
292
+ V(state_string, "state") \
293
+ V(stats_string, "stats") \
294
+ V(status_string, "status") \
295
+ V(stdio_string, "stdio") \
296
+ V(stream_average_duration_string, "streamAverageDuration") \
297
+ V(stream_count_string, "streamCount") \
298
+ V(subject_string, "subject") \
299
+ V(subjectaltname_string, "subjectaltname") \
300
+ V(syscall_string, "syscall") \
301
+ V(target_string, "target") \
302
+ V(thread_id_string, "threadId") \
303
+ V(ticketkeycallback_string, "onticketkeycallback") \
304
+ V(timeout_string, "timeout") \
305
+ V(time_to_first_byte_string, "timeToFirstByte") \
306
+ V(time_to_first_byte_sent_string, "timeToFirstByteSent") \
307
+ V(time_to_first_header_string, "timeToFirstHeader") \
308
+ V(tls_ticket_string, "tlsTicket") \
309
+ V(transfer_string, "transfer") \
310
+ V(ttl_string, "ttl") \
311
+ V(type_string, "type") \
312
+ V(uid_string, "uid") \
313
+ V(unknown_string, "<unknown>") \
314
+ V(url_special_ftp_string, "ftp:") \
315
+ V(url_special_file_string, "file:") \
316
+ V(url_special_http_string, "http:") \
317
+ V(url_special_https_string, "https:") \
318
+ V(url_special_ws_string, "ws:") \
319
+ V(url_special_wss_string, "wss:") \
320
+ V(url_string, "url") \
321
+ V(username_string, "username") \
322
+ V(valid_from_string, "valid_from") \
323
+ V(valid_to_string, "valid_to") \
324
+ V(value_string, "value") \
325
+ V(verify_error_string, "verifyError") \
326
+ V(version_string, "version") \
327
+ V(weight_string, "weight") \
328
+ V(windows_hide_string, "windowsHide") \
329
+ V(windows_verbatim_arguments_string, "windowsVerbatimArguments") \
330
+ V(wrap_string, "wrap") \
331
+ V(writable_string, "writable") \
332
+ V(write_host_object_string, "_writeHostObject") \
333
+ V(write_queue_size_string, "writeQueueSize") \
334
+ V(x_forwarded_string, "x-forwarded-for")
335
+
336
+ #define PER_ISOLATE_TEMPLATE_PROPERTIES(V) \
337
+ V(async_wrap_ctor_template, v8::FunctionTemplate) \
338
+ V(async_wrap_object_ctor_template, v8::FunctionTemplate) \
339
+ V(binding_data_default_template, v8::ObjectTemplate) \
340
+ V(blob_constructor_template, v8::FunctionTemplate) \
341
+ V(blob_reader_constructor_template, v8::FunctionTemplate) \
342
+ V(blocklist_constructor_template, v8::FunctionTemplate) \
343
+ V(contextify_global_template, v8::ObjectTemplate) \
344
+ V(contextify_wrapper_template, v8::ObjectTemplate) \
345
+ V(crypto_key_object_handle_constructor, v8::FunctionTemplate) \
346
+ V(env_proxy_template, v8::ObjectTemplate) \
347
+ V(env_proxy_ctor_template, v8::FunctionTemplate) \
348
+ V(dir_instance_template, v8::ObjectTemplate) \
349
+ V(fd_constructor_template, v8::ObjectTemplate) \
350
+ V(fdclose_constructor_template, v8::ObjectTemplate) \
351
+ V(fdentry_constructor_template, v8::FunctionTemplate) \
352
+ V(filehandlereadwrap_template, v8::ObjectTemplate) \
353
+ V(fsreqpromise_constructor_template, v8::ObjectTemplate) \
354
+ V(handle_wrap_ctor_template, v8::FunctionTemplate) \
355
+ V(histogram_ctor_template, v8::FunctionTemplate) \
356
+ V(http2settings_constructor_template, v8::ObjectTemplate) \
357
+ V(http2stream_constructor_template, v8::ObjectTemplate) \
358
+ V(http2ping_constructor_template, v8::ObjectTemplate) \
359
+ V(i18n_converter_template, v8::ObjectTemplate) \
360
+ V(intervalhistogram_constructor_template, v8::FunctionTemplate) \
361
+ V(libuv_stream_wrap_ctor_template, v8::FunctionTemplate) \
362
+ V(message_port_constructor_template, v8::FunctionTemplate) \
363
+ V(microtask_queue_ctor_template, v8::FunctionTemplate) \
364
+ V(pipe_constructor_template, v8::FunctionTemplate) \
365
+ V(promise_wrap_template, v8::ObjectTemplate) \
366
+ V(sab_lifetimepartner_constructor_template, v8::FunctionTemplate) \
367
+ V(script_context_constructor_template, v8::FunctionTemplate) \
368
+ V(secure_context_constructor_template, v8::FunctionTemplate) \
369
+ V(shutdown_wrap_template, v8::ObjectTemplate) \
370
+ V(socketaddress_constructor_template, v8::FunctionTemplate) \
371
+ V(streambaseentry_ctor_template, v8::FunctionTemplate) \
372
+ V(streambaseoutputstream_constructor_template, v8::ObjectTemplate) \
373
+ V(streamentry_ctor_template, v8::FunctionTemplate) \
374
+ V(streamentry_opaque_ctor_template, v8::FunctionTemplate) \
375
+ V(qlogoutputstream_constructor_template, v8::ObjectTemplate) \
376
+ V(tcp_constructor_template, v8::FunctionTemplate) \
377
+ V(tty_constructor_template, v8::FunctionTemplate) \
378
+ V(write_wrap_template, v8::ObjectTemplate) \
379
+ V(worker_heap_snapshot_taker_template, v8::ObjectTemplate) \
380
+ V(x509_constructor_template, v8::FunctionTemplate)
381
+
382
+ #define PER_REALM_STRONG_PERSISTENT_VALUES(V) \
383
+ V(async_hooks_after_function, v8::Function) \
384
+ V(async_hooks_before_function, v8::Function) \
385
+ V(async_hooks_callback_trampoline, v8::Function) \
386
+ V(async_hooks_binding, v8::Object) \
387
+ V(async_hooks_destroy_function, v8::Function) \
388
+ V(async_hooks_init_function, v8::Function) \
389
+ V(async_hooks_promise_resolve_function, v8::Function) \
390
+ V(buffer_prototype_object, v8::Object) \
391
+ V(crypto_key_object_constructor, v8::Function) \
392
+ V(crypto_key_object_private_constructor, v8::Function) \
393
+ V(crypto_key_object_public_constructor, v8::Function) \
394
+ V(crypto_key_object_secret_constructor, v8::Function) \
395
+ V(domexception_function, v8::Function) \
396
+ V(enhance_fatal_stack_after_inspector, v8::Function) \
397
+ V(enhance_fatal_stack_before_inspector, v8::Function) \
398
+ V(get_source_map_error_source, v8::Function) \
399
+ V(host_import_module_dynamically_callback, v8::Function) \
400
+ V(host_initialize_import_meta_object_callback, v8::Function) \
401
+ V(http2session_on_altsvc_function, v8::Function) \
402
+ V(http2session_on_error_function, v8::Function) \
403
+ V(http2session_on_frame_error_function, v8::Function) \
404
+ V(http2session_on_goaway_data_function, v8::Function) \
405
+ V(http2session_on_headers_function, v8::Function) \
406
+ V(http2session_on_origin_function, v8::Function) \
407
+ V(http2session_on_ping_function, v8::Function) \
408
+ V(http2session_on_priority_function, v8::Function) \
409
+ V(http2session_on_settings_function, v8::Function) \
410
+ V(http2session_on_stream_close_function, v8::Function) \
411
+ V(http2session_on_stream_trailers_function, v8::Function) \
412
+ V(internal_binding_loader, v8::Function) \
413
+ V(immediate_callback_function, v8::Function) \
414
+ V(inspector_console_extension_installer, v8::Function) \
415
+ V(inspector_disable_async_hooks, v8::Function) \
416
+ V(inspector_enable_async_hooks, v8::Function) \
417
+ V(maybe_cache_generated_source_map, v8::Function) \
418
+ V(messaging_deserialize_create_object, v8::Function) \
419
+ V(message_port, v8::Object) \
420
+ V(builtin_module_require, v8::Function) \
421
+ V(performance_entry_callback, v8::Function) \
422
+ V(prepare_stack_trace_callback, v8::Function) \
423
+ V(process_object, v8::Object) \
424
+ V(primordials, v8::Object) \
425
+ V(primordials_safe_map_prototype_object, v8::Object) \
426
+ V(primordials_safe_set_prototype_object, v8::Object) \
427
+ V(primordials_safe_weak_map_prototype_object, v8::Object) \
428
+ V(primordials_safe_weak_set_prototype_object, v8::Object) \
429
+ V(promise_hook_handler, v8::Function) \
430
+ V(promise_reject_callback, v8::Function) \
431
+ V(snapshot_serialize_callback, v8::Function) \
432
+ V(snapshot_deserialize_callback, v8::Function) \
433
+ V(snapshot_deserialize_main, v8::Function) \
434
+ V(source_map_cache_getter, v8::Function) \
435
+ V(tick_callback_function, v8::Function) \
436
+ V(timers_callback_function, v8::Function) \
437
+ V(tls_wrap_constructor_function, v8::Function) \
438
+ V(trace_category_state_function, v8::Function) \
439
+ V(udp_constructor_function, v8::Function) \
440
+ V(url_constructor_function, v8::Function) \
441
+ V(wasm_streaming_compilation_impl, v8::Function) \
442
+ V(wasm_streaming_object_constructor, v8::Function)
443
+
444
+ #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
445
+
446
+ #endif // SRC_ENV_PROPERTIES_H_
@@ -0,0 +1,123 @@
1
+ // Copyright Joyent, Inc. and other Node contributors.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a
4
+ // copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the
9
+ // following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included
12
+ // in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ #ifndef SRC_HANDLE_WRAP_H_
23
+ #define SRC_HANDLE_WRAP_H_
24
+
25
+ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
26
+
27
+ #include "async_wrap.h"
28
+ #include "util.h"
29
+ #include "uv.h"
30
+ #include "v8.h"
31
+
32
+ namespace node {
33
+
34
+ class Environment;
35
+ class ExternalReferenceRegistry;
36
+
37
+ // Rules:
38
+ //
39
+ // - Do not throw from handle methods. Set errno.
40
+ //
41
+ // - MakeCallback may only be made directly off the event loop.
42
+ // That is there can be no JavaScript stack frames underneath it.
43
+ // (Is there any way to assert that?)
44
+ //
45
+ // - No use of v8::WeakReferenceCallback. The close callback signifies that
46
+ // we're done with a handle - external resources can be freed.
47
+ //
48
+ // - Reusable?
49
+ //
50
+ // - The uv_close_cb is used to free the c++ object. The close callback
51
+ // is not made into javascript land.
52
+ //
53
+ // - uv_ref, uv_unref counts are managed at this layer to avoid needless
54
+ // js/c++ boundary crossing. At the javascript layer that should all be
55
+ // taken care of.
56
+
57
+ class HandleWrap : public AsyncWrap {
58
+ public:
59
+ static void Close(const v8::FunctionCallbackInfo<v8::Value>& args);
60
+ static void Ref(const v8::FunctionCallbackInfo<v8::Value>& args);
61
+ static void Unref(const v8::FunctionCallbackInfo<v8::Value>& args);
62
+ static void HasRef(const v8::FunctionCallbackInfo<v8::Value>& args);
63
+
64
+ static inline bool IsAlive(const HandleWrap* wrap) {
65
+ return wrap != nullptr &&
66
+ wrap->IsDoneInitializing() &&
67
+ wrap->state_ != kClosed;
68
+ }
69
+
70
+ static inline bool HasRef(const HandleWrap* wrap) {
71
+ return IsAlive(wrap) && uv_has_ref(wrap->GetHandle());
72
+ }
73
+
74
+ inline uv_handle_t* GetHandle() const { return handle_; }
75
+
76
+ virtual void Close(
77
+ v8::Local<v8::Value> close_callback = v8::Local<v8::Value>());
78
+
79
+ static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
80
+ IsolateData* isolate_data);
81
+ static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
82
+ Environment* env);
83
+ static void RegisterExternalReferences(ExternalReferenceRegistry* registry);
84
+
85
+ protected:
86
+ HandleWrap(Environment* env,
87
+ v8::Local<v8::Object> object,
88
+ uv_handle_t* handle,
89
+ AsyncWrap::ProviderType provider);
90
+ virtual void OnClose() {}
91
+ void OnGCCollect() final;
92
+ bool IsNotIndicativeOfMemoryLeakAtExit() const override;
93
+
94
+ void MarkAsInitialized();
95
+ void MarkAsUninitialized();
96
+
97
+ inline bool IsHandleClosing() const {
98
+ return state_ == kClosing || state_ == kClosed;
99
+ }
100
+
101
+ static void OnClose(uv_handle_t* handle);
102
+ enum { kInitialized, kClosing, kClosed } state_;
103
+
104
+ private:
105
+ friend class Environment;
106
+ friend void GetActiveHandles(const v8::FunctionCallbackInfo<v8::Value>&);
107
+
108
+ // handle_wrap_queue_ needs to be at a fixed offset from the start of the
109
+ // class because it is used by src/node_postmortem_metadata.cc to calculate
110
+ // offsets and generate debug symbols for HandleWrap, which assumes that the
111
+ // position of members in memory are predictable. For more information please
112
+ // refer to `doc/contributing/node-postmortem-support.md`
113
+ friend int GenDebugSymbols();
114
+ ListNode<HandleWrap> handle_wrap_queue_;
115
+ uv_handle_t* const handle_;
116
+ };
117
+
118
+
119
+ } // namespace node
120
+
121
+ #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
122
+
123
+ #endif // SRC_HANDLE_WRAP_H_