File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -1259,7 +1259,7 @@ inline String String::New(napi_env env, const std::u16string& val) {
12591259}
12601260
12611261#if __cplusplus >= 201703L
1262- inline String String::New (napi_env env, const std::string_view& val) {
1262+ inline String String::New (napi_env env, std::string_view val) {
12631263 return String::New (env, val.data (), val.size ());
12641264}
12651265#endif
@@ -1373,6 +1373,13 @@ inline Symbol Symbol::New(napi_env env, const std::string& description) {
13731373 return Symbol::New (env, descriptionValue);
13741374}
13751375
1376+ #if __cplusplus >= 201703L
1377+ inline Symbol Symbol::New (napi_env env, std::string_view description) {
1378+ napi_value descriptionValue = String::New (env, description);
1379+ return Symbol::New (env, descriptionValue);
1380+ }
1381+ #endif
1382+
13761383inline Symbol Symbol::New (napi_env env, String description) {
13771384 napi_value descriptionValue = description;
13781385 return Symbol::New (env, descriptionValue);
Original file line number Diff line number Diff line change @@ -723,9 +723,8 @@ class String : public Name {
723723
724724#if __cplusplus >= 201703L
725725 // / Creates a new String value from a UTF-8 encoded C++ string view.
726- static String New (
727- napi_env env, // /< Node-API environment
728- const std::string_view& value // /< UTF-8 encoded C++ string view
726+ static String New (napi_env env, // /< Node-API environment
727+ std::string_view value // /< UTF-8 encoded C++ string view
729728 );
730729#endif
731730
@@ -802,6 +801,15 @@ class Symbol : public Name {
802801 description // /< UTF-8 encoded C++ string describing the symbol
803802 );
804803
804+ #if __cplusplus >= 201703L
805+ // / Creates a new Symbol value with a description.
806+ static Symbol New (
807+ napi_env env, // /< Node-API environment
808+ std::string_view
809+ description // /< UTF-8 encoded C++ string view describing the symbol
810+ );
811+ #endif
812+
805813 // / Creates a new Symbol value with a description.
806814 static Symbol New (napi_env env, // /< Node-API environment
807815 String description // /< String value describing the symbol
You can’t perform that action at this time.
0 commit comments