node-addon-api 8.3.0 → 8.4.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
@@ -19,7 +19,7 @@ and exception handling semantics with low overhead.
19
19
  API references are available in the [doc](doc/README.md) directory.
20
20
 
21
21
  <!-- x-release-please-start-version -->
22
- ## Current version: 8.3.0
22
+ ## Current version: 8.4.0
23
23
  <!-- x-release-please-end -->
24
24
 
25
25
  (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
@@ -92,4 +92,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around
92
92
 
93
93
  Licensed under [MIT](./LICENSE.md)
94
94
 
95
- [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
95
+ [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#node-api-version-matrix
package/napi-inl.h CHANGED
@@ -1577,6 +1577,11 @@ inline Object::PropertyLValue<Key>& Object::PropertyLValue<Key>::operator=(
1577
1577
  return *this;
1578
1578
  }
1579
1579
 
1580
+ template <typename Key>
1581
+ inline Value Object::PropertyLValue<Key>::AsValue() const {
1582
+ return Value(*this);
1583
+ }
1584
+
1580
1585
  template <typename Key>
1581
1586
  inline Object::PropertyLValue<Key>::PropertyLValue(Object object, Key key)
1582
1587
  : _env(object.Env()), _object(object), _key(key) {}
@@ -3244,7 +3249,7 @@ inline void Error::ThrowAsJavaScriptException() const {
3244
3249
 
3245
3250
  status = napi_throw(_env, Value());
3246
3251
 
3247
- #ifdef NAPI_EXPERIMENTAL
3252
+ #if (NAPI_VERSION >= 10)
3248
3253
  napi_status expected_failure_mode = napi_cannot_run_js;
3249
3254
  #else
3250
3255
  napi_status expected_failure_mode = napi_pending_exception;
package/napi.h CHANGED
@@ -860,6 +860,9 @@ class Object : public TypeTaggable {
860
860
  template <typename ValueType>
861
861
  PropertyLValue& operator=(ValueType value);
862
862
 
863
+ /// Converts an L-value to a value. For convenience.
864
+ Value AsValue() const;
865
+
863
866
  private:
864
867
  PropertyLValue() = delete;
865
868
  PropertyLValue(Object object, Key key);
package/package.json CHANGED
@@ -423,7 +423,7 @@
423
423
  "clang-format": "^1.4.0",
424
424
  "eslint": "^9.13.0",
425
425
  "fs-extra": "^11.1.1",
426
- "neostandard": "^0.11.7",
426
+ "neostandard": "^0.12.0",
427
427
  "pre-commit": "^1.2.2",
428
428
  "semver": "^7.6.0"
429
429
  },
@@ -472,7 +472,7 @@
472
472
  "lint:fix": "eslint --fix && node tools/clang-format --fix"
473
473
  },
474
474
  "pre-commit": "lint",
475
- "version": "8.3.0",
475
+ "version": "8.4.0",
476
476
  "support": true,
477
477
  "engines": {
478
478
  "node": "^18 || ^20 || >= 21"