Skip to content

Add String::New overload for string_view#1706

Open
cacharle wants to merge 3 commits intonodejs:mainfrom
cacharle:add-string-new-from-string-view
Open

Add String::New overload for string_view#1706
cacharle wants to merge 3 commits intonodejs:mainfrom
cacharle:add-string-new-from-string-view

Conversation

@cacharle
Copy link

Fixes #1703

@cacharle
Copy link
Author

I added the New overload for Symbol aswell. I looked at other functions that take const char* but there is way too many of them and I don't want to unnecessarily bloat the code / break something so let me know if there is other place which could benefit from this overload

@cacharle cacharle marked this pull request as ready for review February 1, 2026 17:11
@legendecas
Copy link
Member

Would you mind adding a test case in https://github.com/nodejs/node-addon-api/blob/main/test/name.cc? Thank you!

@legendecas
Copy link
Member

I added the New overload for Symbol aswell. I looked at other functions that take const char* but there is way too many of them and I don't want to unnecessarily bloat the code / break something so let me know if there is other place which could benefit from this overload

Sounds good! we can start with these two sites.

@cacharle
Copy link
Author

cacharle commented Feb 3, 2026

Same as #1705, the test take too long to compile, not sure how to run them

@legendecas legendecas moved this from Need Triage to In Progress in Node-API Team Project Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add String::New for std::string_view

2 participants