You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2020/04/14 18:54:57 UTC
[couchdb] 01/04: Remove unused string conversion function
This is an automated email from the ASF dual-hosted git repository.
davisp pushed a commit to branch fix-couchjs-utf8-conversions
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 23529d3b5324e4593630f4c4c69f8ca0e4e7a68c
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Apr 14 13:21:01 2020 -0500
Remove unused string conversion function
---
src/couch/priv/couch_js/60/util.cpp | 13 -------------
src/couch/priv/couch_js/60/util.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/src/couch/priv/couch_js/60/util.cpp b/src/couch/priv/couch_js/60/util.cpp
index 92c6cbf..ad68f26 100644
--- a/src/couch/priv/couch_js/60/util.cpp
+++ b/src/couch/priv/couch_js/60/util.cpp
@@ -37,19 +37,6 @@ js_to_string(JSContext* cx, JS::HandleValue val)
return chars.get();
}
-std::string
-js_to_string(JSContext* cx, JSString *str)
-{
- JS::UniqueChars chars(JS_EncodeString(cx, str));
- if(!chars) {
- JS_ClearPendingException(cx);
- fprintf(stderr, "Error converting to string.\n");
- exit(3);
- }
-
- return chars.get();
-}
-
JSString*
string_to_js(JSContext* cx, const std::string& s)
{
diff --git a/src/couch/priv/couch_js/60/util.h b/src/couch/priv/couch_js/60/util.h
index 407e3e6..0c9f0f8 100644
--- a/src/couch/priv/couch_js/60/util.h
+++ b/src/couch/priv/couch_js/60/util.h
@@ -26,7 +26,6 @@ typedef struct {
} couch_args;
std::string js_to_string(JSContext* cx, JS::HandleValue val);
-std::string js_to_string(JSContext* cx, JSString *str);
JSString* string_to_js(JSContext* cx, const std::string& s);
couch_args* couch_parse_args(int argc, const char* argv[]);