feat: add Object::New overload utilizing node_api_create_object_with_properties - #1735
Open
KevinEady wants to merge 1 commit into
Open
feat: add Object::New overload utilizing node_api_create_object_with_properties#1735KevinEady wants to merge 1 commit into
KevinEady wants to merge 1 commit into
Conversation
KevinEady
force-pushed
the
add-node_api_create_object_with_properties
branch
4 times, most recently
from
June 5, 2026 13:24
bbf03d9 to
ef2601b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1735 +/- ##
=======================================
Coverage 63.69% 63.69%
=======================================
Files 3 3
Lines 2063 2063
Branches 730 730
=======================================
Hits 1314 1314
Misses 162 162
Partials 587 587 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
The CI failure is nodejs/node-gyp#3327 |
KevinEady
force-pushed
the
add-node_api_create_object_with_properties
branch
2 times, most recently
from
July 31, 2026 13:02
eb9b7ef to
e725910
Compare
KevinEady
marked this pull request as draft
July 31, 2026 13:02
KevinEady
force-pushed
the
add-node_api_create_object_with_properties
branch
from
July 31, 2026 14:30
e725910 to
23b62a9
Compare
KevinEady
marked this pull request as ready for review
July 31, 2026 14:30
legendecas
reviewed
Jul 31, 2026
| std::vector<napi_value>& propertyNames, | ||
| std::vector<napi_value>& propertyValues) { | ||
| if (propertyNames.size() != propertyValues.size()) { | ||
| Napi::Error::New(env, "Mismatch in size of property names and values") |
Member
There was a problem hiding this comment.
This should prefer NAPI_THROW to throw as a c++ exception when it is enabled:
Suggested change
| Napi::Error::New(env, "Mismatch in size of property names and values") | |
| NAPI_THROW( | |
| Napi::Error::New(env, "Mismatch in size of property names and values"), | |
| Object()); |
legendecas
reviewed
Jul 31, 2026
Comment on lines
+911
to
+912
| std::vector<napi_value>& propertyNames, ///< Property names | ||
| std::vector<napi_value>& propertyValues ///< Property values |
Member
There was a problem hiding this comment.
This could take const vectors:
Suggested change
| std::vector<napi_value>& propertyNames, ///< Property names | |
| std::vector<napi_value>& propertyValues ///< Property values | |
| const std::vector<napi_value>& propertyNames, ///< Property names | |
| const std::vector<napi_value>& propertyValues ///< Property values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
Object::Newoverload utilizingnode_api_create_object_with_properties