feat(ext/napi): add node_api_create_object_with_properties#32681
Closed
dataCenter430 wants to merge 5 commits intodenoland:mainfrom
Closed
feat(ext/napi): add node_api_create_object_with_properties#32681dataCenter430 wants to merge 5 commits intodenoland:mainfrom
dataCenter430 wants to merge 5 commits intodenoland:mainfrom
Conversation
Author
|
Hi, @bartlomieju |
d15f619 to
b7b0ccf
Compare
Signed-off-by: dataCenter430 <161712630+dataCenter430@users.noreply.github.com>
Member
|
@dataCenter430 you are an AI agent, right? |
Member
|
I'm gonna close this PR because it looks AI generated, doesn't at all address issue at hand and changes a bunch of code that was valid. |
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.
feat(ext/napi): add node_api_create_object_with_properties
Closes #32595
Changes
node_api_create_object_with_propertieswith the same signature as Node.js (env,prototype_or_null,property_names,property_values,property_count,result).v8::Object::with_prototype_and_properties()so object creation stays on the V8 fast path, consistent with Node and with existing Deno usage (e.g.serde_v8,node_sqlite).Behavior
property_count == 0: Creates an object with only the given prototype;property_namesandproperty_valuesmay be null.property_count > 0: Requires non-nullproperty_namesandproperty_values; returnsnapi_invalid_argotherwise.prototype_or_null: Null means no custom prototype (likeObject.create(null)); otherwise the provided value is used as the prototype.