node-linux-s390x 24.11.1 → 25.1.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 (48) hide show
  1. package/CHANGELOG.md +270 -1945
  2. package/bin/node +0 -0
  3. package/include/node/common.gypi +1 -13
  4. package/include/node/config.gypi +10 -9
  5. package/include/node/cppgc/allocation.h +3 -3
  6. package/include/node/cppgc/cross-thread-persistent.h +25 -29
  7. package/include/node/cppgc/internal/finalizer-trait.h +1 -1
  8. package/include/node/cppgc/internal/gc-info.h +3 -3
  9. package/include/node/cppgc/internal/logging.h +2 -2
  10. package/include/node/cppgc/internal/name-trait.h +1 -1
  11. package/include/node/cppgc/internal/pointer-policies.h +3 -3
  12. package/include/node/cppgc/member.h +10 -4
  13. package/include/node/cppgc/persistent.h +14 -15
  14. package/include/node/cppgc/platform.h +1 -1
  15. package/include/node/cppgc/trace-trait.h +1 -2
  16. package/include/node/cppgc/visitor.h +14 -9
  17. package/include/node/js_native_api.h +12 -0
  18. package/include/node/node.h +34 -78
  19. package/include/node/node_version.h +6 -6
  20. package/include/node/v8-array-buffer.h +1 -1
  21. package/include/node/v8-callbacks.h +3 -4
  22. package/include/node/v8-context.h +15 -5
  23. package/include/node/v8-data.h +5 -0
  24. package/include/node/v8-debug.h +11 -0
  25. package/include/node/v8-function-callback.h +26 -26
  26. package/include/node/v8-internal.h +136 -36
  27. package/include/node/v8-isolate.h +75 -16
  28. package/include/node/v8-json.h +8 -1
  29. package/include/node/v8-local-handle.h +112 -13
  30. package/include/node/v8-maybe.h +34 -10
  31. package/include/node/v8-memory-span.h +9 -4
  32. package/include/node/v8-message.h +3 -0
  33. package/include/node/v8-object.h +87 -24
  34. package/include/node/v8-persistent-handle.h +4 -4
  35. package/include/node/v8-platform.h +92 -28
  36. package/include/node/v8-primitive.h +22 -9
  37. package/include/node/v8-profiler.h +4 -0
  38. package/include/node/v8-sandbox.h +16 -0
  39. package/include/node/v8-script.h +17 -0
  40. package/include/node/v8-source-location.h +19 -26
  41. package/include/node/v8-template.h +37 -15
  42. package/include/node/v8-traced-handle.h +6 -6
  43. package/include/node/v8-unwinder.h +13 -0
  44. package/include/node/v8-version.h +4 -4
  45. package/include/node/v8config.h +65 -5
  46. package/package.json +1 -1
  47. package/share/doc/node/gdbinit +221 -4
  48. package/share/man/man1/node.1 +16 -3
@@ -175,35 +175,6 @@ NODE_DEPRECATED("Use UVException(isolate, ...)",
175
175
  path);
176
176
  })
177
177
 
178
- /*
179
- * These methods need to be called in a HandleScope.
180
- *
181
- * It is preferred that you use the `MakeCallback` overloads taking
182
- * `async_context` arguments.
183
- */
184
-
185
- NODE_DEPRECATED("Use MakeCallback(..., async_context)",
186
- NODE_EXTERN v8::Local<v8::Value> MakeCallback(
187
- v8::Isolate* isolate,
188
- v8::Local<v8::Object> recv,
189
- const char* method,
190
- int argc,
191
- v8::Local<v8::Value>* argv));
192
- NODE_DEPRECATED("Use MakeCallback(..., async_context)",
193
- NODE_EXTERN v8::Local<v8::Value> MakeCallback(
194
- v8::Isolate* isolate,
195
- v8::Local<v8::Object> recv,
196
- v8::Local<v8::String> symbol,
197
- int argc,
198
- v8::Local<v8::Value>* argv));
199
- NODE_DEPRECATED("Use MakeCallback(..., async_context)",
200
- NODE_EXTERN v8::Local<v8::Value> MakeCallback(
201
- v8::Isolate* isolate,
202
- v8::Local<v8::Object> recv,
203
- v8::Local<v8::Function> callback,
204
- int argc,
205
- v8::Local<v8::Value>* argv));
206
-
207
178
  } // namespace node
208
179
 
209
180
  #include <cassert>
@@ -329,22 +300,6 @@ NODE_EXTERN int Start(int argc, char* argv[]);
329
300
  NODE_EXTERN int Stop(Environment* env,
330
301
  StopFlags::Flags flags = StopFlags::kNoFlags);
331
302
 
332
- // Set up per-process state needed to run Node.js. This will consume arguments
333
- // from argv, fill exec_argv, and possibly add errors resulting from parsing
334
- // the arguments to `errors`. The return value is a suggested exit code for the
335
- // program; If it is 0, then initializing Node.js succeeded.
336
- // This runs a subset of the initialization performed by
337
- // InitializeOncePerProcess(), which supersedes this function.
338
- // The subset is roughly equivalent to the one given by
339
- // `ProcessInitializationFlags::kLegacyInitializeNodeWithArgsBehavior`.
340
- NODE_DEPRECATED("Use InitializeOncePerProcess() instead",
341
- NODE_EXTERN int InitializeNodeWithArgs(
342
- std::vector<std::string>* argv,
343
- std::vector<std::string>* exec_argv,
344
- std::vector<std::string>* errors,
345
- ProcessInitializationFlags::Flags flags =
346
- ProcessInitializationFlags::kNoFlags));
347
-
348
303
  // Set up per-process state needed to run Node.js. This will consume arguments
349
304
  // from args, and return information about the initialization success,
350
305
  // including the arguments split into argv/exec_argv, a list of potential
@@ -839,23 +794,23 @@ NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
839
794
  // is included in the report.
840
795
  // Returns the filename of the written report.
841
796
  NODE_EXTERN std::string TriggerNodeReport(v8::Isolate* isolate,
842
- const char* message,
843
- const char* trigger,
844
- const std::string& filename,
797
+ std::string_view message,
798
+ std::string_view trigger,
799
+ std::string_view filename,
845
800
  v8::Local<v8::Value> error);
846
801
  NODE_EXTERN std::string TriggerNodeReport(Environment* env,
847
- const char* message,
848
- const char* trigger,
849
- const std::string& filename,
802
+ std::string_view message,
803
+ std::string_view trigger,
804
+ std::string_view filename,
850
805
  v8::Local<v8::Value> error);
851
806
  NODE_EXTERN void GetNodeReport(v8::Isolate* isolate,
852
- const char* message,
853
- const char* trigger,
807
+ std::string_view message,
808
+ std::string_view trigger,
854
809
  v8::Local<v8::Value> error,
855
810
  std::ostream& out);
856
811
  NODE_EXTERN void GetNodeReport(Environment* env,
857
- const char* message,
858
- const char* trigger,
812
+ std::string_view message,
813
+ std::string_view trigger,
859
814
  v8::Local<v8::Value> error,
860
815
  std::ostream& out);
861
816
 
@@ -864,32 +819,21 @@ NODE_EXTERN void GetNodeReport(Environment* env,
864
819
  NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
865
820
  NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
866
821
 
867
- NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
868
- NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
869
- int thread_pool_size,
870
- v8::TracingController* tracing_controller));
871
- NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
872
- NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform));
873
-
874
- // Get/set the currently active tracing controller. Using CreatePlatform()
875
- // will implicitly set this by default. This is global and should be initialized
876
- // along with the v8::Platform instance that is being used. `controller`
877
- // is allowed to be `nullptr`.
878
- // This is used for tracing events from Node.js itself. V8 uses the tracing
879
- // controller returned from the active `v8::Platform` instance.
822
+ // Get/set the currently active tracing controller. Using
823
+ // MultiIsolatePlatform::Create() will implicitly set this by default. This is
824
+ // global and should be initialized along with the v8::Platform instance that is
825
+ // being used. `controller` is allowed to be `nullptr`. This is used for tracing
826
+ // events from Node.js itself. V8 uses the tracing controller returned from the
827
+ // active `v8::Platform` instance.
880
828
  NODE_EXTERN v8::TracingController* GetTracingController();
881
829
  NODE_EXTERN void SetTracingController(v8::TracingController* controller);
882
830
 
883
831
  // Run `process.emit('beforeExit')` as it would usually happen when Node.js is
884
832
  // run in standalone mode.
885
833
  NODE_EXTERN v8::Maybe<bool> EmitProcessBeforeExit(Environment* env);
886
- NODE_DEPRECATED("Use Maybe version (EmitProcessBeforeExit) instead",
887
- NODE_EXTERN void EmitBeforeExit(Environment* env));
888
834
  // Run `process.emit('exit')` as it would usually happen when Node.js is run
889
835
  // in standalone mode. The return value corresponds to the exit code.
890
836
  NODE_EXTERN v8::Maybe<int> EmitProcessExit(Environment* env);
891
- NODE_DEPRECATED("Use Maybe version (EmitProcessExit) instead",
892
- NODE_EXTERN int EmitExit(Environment* env));
893
837
 
894
838
  // Runs hooks added through `AtExit()`. This is part of `FreeEnvironment()`,
895
839
  // so calling it manually is typically not necessary.
@@ -1057,7 +1001,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
1057
1001
 
1058
1002
  #define NODE_DEFINE_CONSTANT(target, constant) \
1059
1003
  do { \
1060
- v8::Isolate* isolate = target->GetIsolate(); \
1004
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); \
1061
1005
  v8::Local<v8::Context> context = isolate->GetCurrentContext(); \
1062
1006
  v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
1063
1007
  isolate, #constant, v8::NewStringType::kInternalized); \
@@ -1073,7 +1017,7 @@ NODE_DEPRECATED("Use v8::Date::ValueOf() directly",
1073
1017
 
1074
1018
  #define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \
1075
1019
  do { \
1076
- v8::Isolate* isolate = target->GetIsolate(); \
1020
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); \
1077
1021
  v8::Local<v8::Context> context = isolate->GetCurrentContext(); \
1078
1022
  v8::Local<v8::String> constant_name = v8::String::NewFromUtf8Literal( \
1079
1023
  isolate, #constant, v8::NewStringType::kInternalized); \
@@ -1504,6 +1448,12 @@ class NODE_EXTERN CallbackScope {
1504
1448
  CallbackScope(Environment* env,
1505
1449
  v8::Local<v8::Object> resource,
1506
1450
  async_context asyncContext);
1451
+ // `resource` needs to outlive the scope in this case.
1452
+ // This is for the rare situation in which `CallbackScope` cannot be
1453
+ // stack-allocated. `resource` needs to outlive this scope.
1454
+ CallbackScope(Environment* env,
1455
+ v8::Global<v8::Object>* resource,
1456
+ async_context asyncContext);
1507
1457
  ~CallbackScope();
1508
1458
 
1509
1459
  void operator=(const CallbackScope&) = delete;
@@ -1512,6 +1462,11 @@ class NODE_EXTERN CallbackScope {
1512
1462
  CallbackScope(CallbackScope&&) = delete;
1513
1463
 
1514
1464
  private:
1465
+ void* resource_storage_global_;
1466
+ union {
1467
+ v8::Local<v8::Object> local;
1468
+ v8::Global<v8::Object>* global_ptr;
1469
+ } resource_storage_;
1515
1470
  InternalCallbackScope* private_;
1516
1471
  v8::TryCatch try_catch_;
1517
1472
  };
@@ -1618,10 +1573,11 @@ void RegisterSignalHandler(int signal,
1618
1573
  // objects on Node.js versions without v8::Object::Wrap(). Addons created to
1619
1574
  // work with only Node.js versions with v8::Object::Wrap() should use that
1620
1575
  // instead.
1621
- NODE_DEPRECATED("Use v8::Object::Wrap()",
1622
- NODE_EXTERN void SetCppgcReference(v8::Isolate* isolate,
1623
- v8::Local<v8::Object> object,
1624
- void* wrappable));
1576
+ NODE_DEPRECATED(
1577
+ "Use v8::Object::Wrap()",
1578
+ NODE_EXTERN void SetCppgcReference(v8::Isolate* isolate,
1579
+ v8::Local<v8::Object> object,
1580
+ v8::Object::Wrappable* wrappable));
1625
1581
 
1626
1582
  } // namespace node
1627
1583
 
@@ -22,12 +22,12 @@
22
22
  #ifndef SRC_NODE_VERSION_H_
23
23
  #define SRC_NODE_VERSION_H_
24
24
 
25
- #define NODE_MAJOR_VERSION 24
26
- #define NODE_MINOR_VERSION 11
27
- #define NODE_PATCH_VERSION 1
25
+ #define NODE_MAJOR_VERSION 25
26
+ #define NODE_MINOR_VERSION 1
27
+ #define NODE_PATCH_VERSION 0
28
28
 
29
- #define NODE_VERSION_IS_LTS 1
30
- #define NODE_VERSION_LTS_CODENAME "Krypton"
29
+ #define NODE_VERSION_IS_LTS 0
30
+ #define NODE_VERSION_LTS_CODENAME ""
31
31
 
32
32
  #define NODE_VERSION_IS_RELEASE 1
33
33
 
@@ -95,7 +95,7 @@
95
95
  #if defined(NODE_EMBEDDER_MODULE_VERSION)
96
96
  #define NODE_MODULE_VERSION NODE_EMBEDDER_MODULE_VERSION
97
97
  #else
98
- #define NODE_MODULE_VERSION 137
98
+ #define NODE_MODULE_VERSION 141
99
99
  #endif
100
100
 
101
101
  // The NAPI_VERSION supported by the runtime. This is the inclusive range of
@@ -198,7 +198,7 @@ class V8_EXPORT ArrayBuffer : public Object {
198
198
  * Convenience allocator.
199
199
  *
200
200
  * When the sandbox is enabled, this allocator will allocate its backing
201
- * memory inside the sandbox that belongs to passed isolate group.
201
+ * memory inside the sandbox that belongs to the passed isolate group.
202
202
  * Otherwise, it will rely on malloc/free.
203
203
  *
204
204
  * Caller takes ownership, i.e. the returned object needs to be freed using
@@ -324,14 +324,13 @@ using WasmLoadSourceMapCallback = Local<String> (*)(Isolate* isolate,
324
324
  // --- Callback for checking if WebAssembly imported strings are enabled ---
325
325
  using WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context);
326
326
 
327
+ // --- Callback for checking if WebAssembly Custom Descriptors are enabled ---
328
+ using WasmCustomDescriptorsEnabledCallback = bool (*)(Local<Context> context);
329
+
327
330
  // --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
328
331
  using SharedArrayBufferConstructorEnabledCallback =
329
332
  bool (*)(Local<Context> context);
330
333
 
331
- // --- Callback for checking if the compile hints magic comments are enabled ---
332
- using JavaScriptCompileHintsMagicEnabledCallback =
333
- bool (*)(Local<Context> context);
334
-
335
334
  // --- Callback for checking if WebAssembly JSPI is enabled ---
336
335
  using WasmJSPIEnabledCallback = bool (*)(Local<Context> context);
337
336
 
@@ -256,6 +256,9 @@ class V8_EXPORT Context : public Data {
256
256
  Maybe<void> DeepFreeze(DeepFreezeDelegate* delegate = nullptr);
257
257
 
258
258
  /** Returns the isolate associated with a current context. */
259
+ V8_DEPRECATED(
260
+ "Use Isolate::GetCurrent() instead, which is guaranteed to return the "
261
+ "same isolate since https://crrev.com/c/6458560.")
259
262
  Isolate* GetIsolate();
260
263
 
261
264
  /** Returns the microtask queue associated with a current context. */
@@ -311,8 +314,14 @@ class V8_EXPORT Context : public Data {
311
314
  * index, growing the data as needed. Note that index 0 currently has a
312
315
  * special meaning for Chrome's debugger.
313
316
  */
317
+ V8_DEPRECATE_SOON(
318
+ "Use SetAlignedPointerInEmbedderData with EmbedderDataTypeTag parameter "
319
+ "instead.")
314
320
  void SetAlignedPointerInEmbedderData(int index, void* value);
315
321
 
322
+ void SetAlignedPointerInEmbedderData(int index, void* value,
323
+ EmbedderDataTypeTag slot);
324
+
316
325
  /**
317
326
  * Control whether code generation from strings is allowed. Calling
318
327
  * this method with false will disable 'eval' and the 'Function'
@@ -451,8 +460,7 @@ Local<Value> Context::GetEmbedderData(int index) {
451
460
  value = I::DecompressTaggedField(embedder_data, static_cast<uint32_t>(value));
452
461
  #endif
453
462
 
454
- auto isolate = reinterpret_cast<v8::Isolate*>(
455
- internal::IsolateFromNeverReadOnlySpaceObject(ctx));
463
+ auto* isolate = I::GetCurrentIsolate();
456
464
  return Local<Value>::New(isolate, value);
457
465
  #else
458
466
  return SlowGetEmbedderData(index);
@@ -470,7 +478,8 @@ void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) {
470
478
  (I::kEmbedderDataSlotSize * index) +
471
479
  I::kEmbedderDataSlotExternalPointerOffset;
472
480
  return reinterpret_cast<void*>(
473
- I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
481
+ I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
482
+ internal::kLastEmbedderDataTag}>(
474
483
  isolate, embedder_data, value_offset));
475
484
  #else
476
485
  return SlowGetAlignedPointerFromEmbedderData(index);
@@ -487,9 +496,10 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
487
496
  int value_offset = I::kEmbedderDataArrayHeaderSize +
488
497
  (I::kEmbedderDataSlotSize * index) +
489
498
  I::kEmbedderDataSlotExternalPointerOffset;
490
- Isolate* isolate = I::GetIsolateForSandbox(ctx);
499
+ Isolate* isolate = I::GetCurrentIsolateForSandbox();
491
500
  return reinterpret_cast<void*>(
492
- I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
501
+ I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
502
+ internal::kLastEmbedderDataTag}>(
493
503
  isolate, embedder_data, value_offset));
494
504
  #else
495
505
  return SlowGetAlignedPointerFromEmbedderData(index);
@@ -57,6 +57,11 @@ class V8_EXPORT Data {
57
57
  */
58
58
  bool IsContext() const;
59
59
 
60
+ /**
61
+ * Returns true if this value is a `CppHeapExternal` object.
62
+ */
63
+ bool IsCppHeapExternal() const;
64
+
60
65
  private:
61
66
  Data() = delete;
62
67
  };
@@ -172,6 +172,17 @@ class V8_EXPORT StackTrace {
172
172
  * a stack trace.
173
173
  */
174
174
  static Local<String> CurrentScriptNameOrSourceURL(Isolate* isolate);
175
+
176
+ /**
177
+ * Returns the first valid script id at the top of
178
+ * the JS stack. The returned value is Message::kNoScriptIdInfo if no id
179
+ * was found.
180
+ *
181
+ * This method is equivalent to calling StackTrace::CurrentStackTrace and
182
+ * walking the resulting frames from the beginning until a non-empty id is
183
+ * found. The difference is that this method won't allocate a stack trace.
184
+ */
185
+ static int CurrentScriptId(Isolate* isolate);
175
186
  };
176
187
 
177
188
  } // namespace v8
@@ -42,7 +42,7 @@ class ReturnValue {
42
42
  public:
43
43
  template <class S>
44
44
  V8_INLINE ReturnValue(const ReturnValue<S>& that) : value_(that.value_) {
45
- static_assert(std::is_base_of<T, S>::value, "type check");
45
+ static_assert(std::is_base_of_v<T, S>, "type check");
46
46
  }
47
47
  // Handle-based setters.
48
48
  template <typename S>
@@ -66,12 +66,12 @@ class ReturnValue {
66
66
  V8_INLINE void Set(uint16_t i);
67
67
  V8_INLINE void Set(uint32_t i);
68
68
  V8_INLINE void Set(uint64_t i);
69
- // Fast JS primitive setters
69
+ // Fast JS primitive setters.
70
70
  V8_INLINE void SetNull();
71
71
  V8_INLINE void SetUndefined();
72
72
  V8_INLINE void SetFalse();
73
73
  V8_INLINE void SetEmptyString();
74
- // Convenience getter for Isolate
74
+ // Convenience getter for the Isolate.
75
75
  V8_INLINE Isolate* GetIsolate() const;
76
76
 
77
77
  // Pointer setter: Uncompilable to prevent inadvertent misuse.
@@ -250,7 +250,7 @@ class PropertyCallbackInfo {
250
250
  *
251
251
  * \note For security reasons, do not pass the object back into the runtime.
252
252
  */
253
- V8_DEPRECATE_SOON(
253
+ V8_DEPRECATED(
254
254
  "V8 will stop providing access to hidden prototype (i.e. "
255
255
  "JSGlobalObject). Use HolderV2() instead. \n"
256
256
  "DO NOT try to workaround this by accessing JSGlobalObject via "
@@ -335,7 +335,7 @@ void ReturnValue<T>::SetInternal(internal::Address value) {
335
335
  template <typename T>
336
336
  template <typename S>
337
337
  void ReturnValue<T>::Set(const Global<S>& handle) {
338
- static_assert(std::is_base_of<T, S>::value, "type check");
338
+ static_assert(std::is_base_of_v<T, S>, "type check");
339
339
  if (V8_UNLIKELY(handle.IsEmpty())) {
340
340
  SetDefaultValue();
341
341
  } else {
@@ -346,7 +346,7 @@ void ReturnValue<T>::Set(const Global<S>& handle) {
346
346
  template <typename T>
347
347
  template <typename S>
348
348
  void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
349
- static_assert(std::is_base_of<T, S>::value, "type check");
349
+ static_assert(std::is_base_of_v<T, S>, "type check");
350
350
  #ifdef V8_ENABLE_CHECKS
351
351
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
352
352
  #endif // V8_ENABLE_CHECKS
@@ -356,7 +356,7 @@ void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
356
356
  template <typename T>
357
357
  template <typename S>
358
358
  void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
359
- static_assert(std::is_base_of<T, S>::value, "type check");
359
+ static_assert(std::is_base_of_v<T, S>, "type check");
360
360
  if (V8_UNLIKELY(handle.IsEmpty())) {
361
361
  SetDefaultValue();
362
362
  } else {
@@ -367,7 +367,7 @@ void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
367
367
  template <typename T>
368
368
  template <typename S>
369
369
  void ReturnValue<T>::SetNonEmpty(const BasicTracedReference<S>& handle) {
370
- static_assert(std::is_base_of<T, S>::value, "type check");
370
+ static_assert(std::is_base_of_v<T, S>, "type check");
371
371
  #ifdef V8_ENABLE_CHECKS
372
372
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
373
373
  #endif // V8_ENABLE_CHECKS
@@ -380,16 +380,16 @@ void ReturnValue<T>::Set(const Local<S> handle) {
380
380
  // "V8_DEPRECATE_SOON" this method if |T| is |void|.
381
381
  #ifdef V8_IMMINENT_DEPRECATION_WARNINGS
382
382
  static constexpr bool is_allowed_void = false;
383
- static_assert(!std::is_void<T>::value,
383
+ static_assert(!std::is_void_v<T>,
384
384
  "ReturnValue<void>::Set(const Local<S>) is deprecated. "
385
385
  "Do nothing to indicate that the operation succeeded or use "
386
386
  "SetFalse() to indicate that the operation failed (don't "
387
387
  "forget to handle info.ShouldThrowOnError()). "
388
388
  "See http://crbug.com/348660658 for details.");
389
389
  #else
390
- static constexpr bool is_allowed_void = std::is_void<T>::value;
390
+ static constexpr bool is_allowed_void = std::is_void_v<T>;
391
391
  #endif // V8_IMMINENT_DEPRECATION_WARNINGS
392
- static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
392
+ static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
393
393
  if (V8_UNLIKELY(handle.IsEmpty())) {
394
394
  SetDefaultValue();
395
395
  } else if constexpr (is_allowed_void) {
@@ -407,16 +407,16 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
407
407
  // "V8_DEPRECATE_SOON" this method if |T| is |void|.
408
408
  #ifdef V8_IMMINENT_DEPRECATION_WARNINGS
409
409
  static constexpr bool is_allowed_void = false;
410
- static_assert(!std::is_void<T>::value,
410
+ static_assert(!std::is_void_v<T>,
411
411
  "ReturnValue<void>::SetNonEmpty(const Local<S>) is deprecated. "
412
412
  "Do nothing to indicate that the operation succeeded or use "
413
413
  "SetFalse() to indicate that the operation failed (don't "
414
414
  "forget to handle info.ShouldThrowOnError()). "
415
415
  "See http://crbug.com/348660658 for details.");
416
416
  #else
417
- static constexpr bool is_allowed_void = std::is_void<T>::value;
417
+ static constexpr bool is_allowed_void = std::is_void_v<T>;
418
418
  #endif // V8_IMMINENT_DEPRECATION_WARNINGS
419
- static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
419
+ static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
420
420
  #ifdef V8_ENABLE_CHECKS
421
421
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
422
422
  #endif // V8_ENABLE_CHECKS
@@ -431,13 +431,13 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
431
431
 
432
432
  template <typename T>
433
433
  void ReturnValue<T>::Set(double i) {
434
- static_assert(std::is_base_of<T, Number>::value, "type check");
434
+ static_assert(std::is_base_of_v<T, Number>, "type check");
435
435
  SetNonEmpty(Number::New(GetIsolate(), i));
436
436
  }
437
437
 
438
438
  template <typename T>
439
439
  void ReturnValue<T>::Set(int16_t i) {
440
- static_assert(std::is_base_of<T, Integer>::value, "type check");
440
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
441
441
  using I = internal::Internals;
442
442
  static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::min()));
443
443
  static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::max()));
@@ -446,7 +446,7 @@ void ReturnValue<T>::Set(int16_t i) {
446
446
 
447
447
  template <typename T>
448
448
  void ReturnValue<T>::Set(int32_t i) {
449
- static_assert(std::is_base_of<T, Integer>::value, "type check");
449
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
450
450
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
451
451
  SetInternal(*result);
452
452
  return;
@@ -456,7 +456,7 @@ void ReturnValue<T>::Set(int32_t i) {
456
456
 
457
457
  template <typename T>
458
458
  void ReturnValue<T>::Set(int64_t i) {
459
- static_assert(std::is_base_of<T, Integer>::value, "type check");
459
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
460
460
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
461
461
  SetInternal(*result);
462
462
  return;
@@ -466,7 +466,7 @@ void ReturnValue<T>::Set(int64_t i) {
466
466
 
467
467
  template <typename T>
468
468
  void ReturnValue<T>::Set(uint16_t i) {
469
- static_assert(std::is_base_of<T, Integer>::value, "type check");
469
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
470
470
  using I = internal::Internals;
471
471
  static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
472
472
  static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
@@ -475,7 +475,7 @@ void ReturnValue<T>::Set(uint16_t i) {
475
475
 
476
476
  template <typename T>
477
477
  void ReturnValue<T>::Set(uint32_t i) {
478
- static_assert(std::is_base_of<T, Integer>::value, "type check");
478
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
479
479
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
480
480
  SetInternal(*result);
481
481
  return;
@@ -485,7 +485,7 @@ void ReturnValue<T>::Set(uint32_t i) {
485
485
 
486
486
  template <typename T>
487
487
  void ReturnValue<T>::Set(uint64_t i) {
488
- static_assert(std::is_base_of<T, Integer>::value, "type check");
488
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
489
489
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
490
490
  SetInternal(*result);
491
491
  return;
@@ -495,7 +495,7 @@ void ReturnValue<T>::Set(uint64_t i) {
495
495
 
496
496
  template <typename T>
497
497
  void ReturnValue<T>::Set(bool value) {
498
- static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
498
+ static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
499
499
  "type check");
500
500
  using I = internal::Internals;
501
501
  #if V8_STATIC_ROOTS_BOOL
@@ -535,7 +535,7 @@ void ReturnValue<T>::SetDefaultValue() {
535
535
 
536
536
  template <typename T>
537
537
  void ReturnValue<T>::SetNull() {
538
- static_assert(std::is_base_of<T, Primitive>::value, "type check");
538
+ static_assert(std::is_base_of_v<T, Primitive>, "type check");
539
539
  using I = internal::Internals;
540
540
  #if V8_STATIC_ROOTS_BOOL
541
541
  #ifdef V8_ENABLE_CHECKS
@@ -550,7 +550,7 @@ void ReturnValue<T>::SetNull() {
550
550
 
551
551
  template <typename T>
552
552
  void ReturnValue<T>::SetUndefined() {
553
- static_assert(std::is_base_of<T, Primitive>::value, "type check");
553
+ static_assert(std::is_base_of_v<T, Primitive>, "type check");
554
554
  using I = internal::Internals;
555
555
  #if V8_STATIC_ROOTS_BOOL
556
556
  #ifdef V8_ENABLE_CHECKS
@@ -565,7 +565,7 @@ void ReturnValue<T>::SetUndefined() {
565
565
 
566
566
  template <typename T>
567
567
  void ReturnValue<T>::SetFalse() {
568
- static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
568
+ static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
569
569
  "type check");
570
570
  using I = internal::Internals;
571
571
  #if V8_STATIC_ROOTS_BOOL
@@ -581,7 +581,7 @@ void ReturnValue<T>::SetFalse() {
581
581
 
582
582
  template <typename T>
583
583
  void ReturnValue<T>::SetEmptyString() {
584
- static_assert(std::is_base_of<T, String>::value, "type check");
584
+ static_assert(std::is_base_of_v<T, String>, "type check");
585
585
  using I = internal::Internals;
586
586
  #if V8_STATIC_ROOTS_BOOL
587
587
  #ifdef V8_ENABLE_CHECKS