node-addon-api 5.1.0 → 6.0.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.
package/README.md CHANGED
@@ -70,7 +70,7 @@ and node-addon-api.
70
70
  - **[Contributors](#contributors)**
71
71
  - **[License](#license)**
72
72
 
73
- ## **Current version: 5.1.0**
73
+ ## **Current version: 6.0.0**
74
74
 
75
75
  (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
76
76
 
package/napi-inl.h CHANGED
@@ -1626,6 +1626,19 @@ inline MaybeOrValue<bool> Object::Seal() const {
1626
1626
  napi_status status = napi_object_seal(_env, _value);
1627
1627
  NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool);
1628
1628
  }
1629
+
1630
+ inline void Object::TypeTag(const napi_type_tag* type_tag) const {
1631
+ napi_status status = napi_type_tag_object(_env, _value, type_tag);
1632
+ NAPI_THROW_IF_FAILED_VOID(_env, status);
1633
+ }
1634
+
1635
+ inline bool Object::CheckTypeTag(const napi_type_tag* type_tag) const {
1636
+ bool result;
1637
+ napi_status status =
1638
+ napi_check_object_type_tag(_env, _value, type_tag, &result);
1639
+ NAPI_THROW_IF_FAILED(_env, status, false);
1640
+ return result;
1641
+ }
1629
1642
  #endif // NAPI_VERSION >= 8
1630
1643
 
1631
1644
  ////////////////////////////////////////////////////////////////////////////////
@@ -4801,29 +4814,6 @@ inline void AsyncWorker::Destroy() {
4801
4814
  delete this;
4802
4815
  }
4803
4816
 
4804
- inline AsyncWorker::AsyncWorker(AsyncWorker&& other) {
4805
- _env = other._env;
4806
- other._env = nullptr;
4807
- _work = other._work;
4808
- other._work = nullptr;
4809
- _receiver = std::move(other._receiver);
4810
- _callback = std::move(other._callback);
4811
- _error = std::move(other._error);
4812
- _suppress_destruct = other._suppress_destruct;
4813
- }
4814
-
4815
- inline AsyncWorker& AsyncWorker::operator=(AsyncWorker&& other) {
4816
- _env = other._env;
4817
- other._env = nullptr;
4818
- _work = other._work;
4819
- other._work = nullptr;
4820
- _receiver = std::move(other._receiver);
4821
- _callback = std::move(other._callback);
4822
- _error = std::move(other._error);
4823
- _suppress_destruct = other._suppress_destruct;
4824
- return *this;
4825
- }
4826
-
4827
4817
  inline AsyncWorker::operator napi_async_work() const {
4828
4818
  return _work;
4829
4819
  }
package/napi.h CHANGED
@@ -980,6 +980,9 @@ class Object : public Value {
980
980
  /// See
981
981
  /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof
982
982
  MaybeOrValue<bool> Seal() const;
983
+
984
+ void TypeTag(const napi_type_tag* type_tag) const;
985
+ bool CheckTypeTag(const napi_type_tag* type_tag) const;
983
986
  #endif // NAPI_VERSION >= 8
984
987
  };
985
988
 
@@ -1791,7 +1794,7 @@ class CallbackInfo {
1791
1794
  Value This() const;
1792
1795
  void* Data() const;
1793
1796
  void SetData(void* data);
1794
- operator napi_callback_info() const;
1797
+ explicit operator napi_callback_info() const;
1795
1798
 
1796
1799
  private:
1797
1800
  const size_t _staticArgCount = 6;
@@ -2436,9 +2439,6 @@ class AsyncWorker {
2436
2439
  public:
2437
2440
  virtual ~AsyncWorker();
2438
2441
 
2439
- // An async worker can be moved but cannot be copied.
2440
- AsyncWorker(AsyncWorker&& other);
2441
- AsyncWorker& operator=(AsyncWorker&& other);
2442
2442
  NAPI_DISALLOW_ASSIGN_COPY(AsyncWorker)
2443
2443
 
2444
2444
  operator napi_async_work() const;
package/package.json CHANGED
@@ -451,6 +451,6 @@
451
451
  "lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix"
452
452
  },
453
453
  "pre-commit": "lint",
454
- "version": "5.1.0",
454
+ "version": "6.0.0",
455
455
  "support": true
456
456
  }