[gjs] js: Remove deprecated JS_ValueToString()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] js: Remove deprecated JS_ValueToString()
- Date: Sat, 10 Dec 2016 03:48:21 +0000 (UTC)
commit 474e75f86e99b95fa108193ab78e36521b664886
Author: Philip Chimento <philip endlessm com>
Date: Tue Oct 18 13:52:52 2016 -0700
js: Remove deprecated JS_ValueToString()
In mozjs31 this is replaced with JS::ToString().
https://bugzilla.gnome.org/show_bug.cgi?id=751252
gi/arg.cpp | 4 ++--
gjs/context.cpp | 18 +++++++++---------
gjs/coverage.cpp | 6 +++---
gjs/jsapi-util.cpp | 4 ++--
modules/console.cpp | 4 ++--
5 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index c0fc24c..6b24c37 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -416,7 +416,7 @@ value_to_ghashtable_key(JSContext *cx,
char *cstr; \
JS::RootedValue str_val(cx, value); \
if (!str_val.isString()) { \
- JS::RootedString str(cx, JS_ValueToString(cx, str_val)); \
+ JS::RootedString str(cx, JS::ToString(cx, str_val)); \
str_val.setString(str); \
} \
if (!gjs_string_to_##lctype(cx, str_val, &cstr)) \
@@ -2555,7 +2555,7 @@ gjs_object_from_g_hash (JSContext *context,
true))
goto out;
- keystr = JS_ValueToString(context, keyjs);
+ keystr = JS::ToString(context, keyjs);
if (!keystr)
goto out;
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 5817957..682d00c 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -118,10 +118,10 @@ gjs_log(JSContext *context,
JS_BeginRequest(context);
- /* JS_ValueToString might throw, in which we will only
- *log that the value could be converted to string */
+ /* JS::ToString might throw, in which case we will only log that the value
+ * could not be converted to string */
exc_state = JS_SaveExceptionState(context);
- JS::RootedString jstr(context, JS_ValueToString(context, argv[0]));
+ JS::RootedString jstr(context, JS::ToString(context, argv[0]));
if (jstr != NULL)
argv[0].setString(jstr); // GC root
JS_RestoreExceptionState(context, exc_state);
@@ -163,10 +163,10 @@ gjs_log_error(JSContext *context,
JS::RootedString jstr(context);
if (argc == 2) {
- /* JS_ValueToString might throw, in which we will only
- *log that the value could be converted to string */
+ /* JS::ToString might throw, in which case we will only log that the
+ * value could be converted to string */
exc_state = JS_SaveExceptionState(context);
- jstr = JS_ValueToString(context, argv[1]);
+ jstr = JS::ToString(context, argv[1]);
if (jstr != NULL)
argv[1].setString(jstr); // GC root
JS_RestoreExceptionState(context, exc_state);
@@ -194,11 +194,11 @@ gjs_print_parse_args(JSContext *context,
for (n = 0; n < argv.length(); ++n) {
JSExceptionState *exc_state;
- /* JS_ValueToString might throw, in which we will only
- * log that the value could be converted to string */
+ /* JS::ToString might throw, in which case we will only log that the
+ * value could not be converted to string */
exc_state = JS_SaveExceptionState(context);
- JS::RootedString jstr(context, JS_ValueToString(context, argv[n]));
+ JS::RootedString jstr(context, JS::ToString(context, argv[n]));
if (jstr != NULL)
argv[n].setString(jstr); // GC root
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 733f68e..036b004 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1333,10 +1333,10 @@ coverage_log(JSContext *context,
return true;
}
- /* JS_ValueToString might throw, in which we will only
- *log that the value could be converted to string */
+ /* JS::ToString might throw, in which case we will only log that the value
+ * could not be converted to string */
exc_state = JS_SaveExceptionState(context);
- JS::RootedString jstr(context, JS_ValueToString(context, argv[0]));
+ JS::RootedString jstr(context, JS::ToString(context, argv[0]));
if (jstr != NULL)
argv[0].setString(jstr); // GC root
JS_RestoreExceptionState(context, exc_state);
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index a26abce..d3d105b 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -460,7 +460,7 @@ gjs_value_debug_string(JSContext *context,
JS_BeginRequest(context);
- JS::RootedString str(context, JS_ValueToString(context, value));
+ JS::RootedString str(context, JS::ToString(context, value));
if (str == NULL) {
if (value.isObject()) {
@@ -509,7 +509,7 @@ utf8_exception_from_non_gerror_value(JSContext *cx,
JS::HandleValue exc)
{
char *utf8_exception = NULL;
- JS::RootedString exc_str(cx, JS_ValueToString(cx, exc));
+ JS::RootedString exc_str(cx, JS::ToString(cx, exc));
if (exc_str != NULL)
gjs_string_to_utf8(cx, JS::StringValue(exc_str), &utf8_exception);
return utf8_exception;
diff --git a/modules/console.cpp b/modules/console.cpp
index a15cbbc..817c722 100644
--- a/modules/console.cpp
+++ b/modules/console.cpp
@@ -200,12 +200,12 @@ gjs_console_interact(JSContext *context,
gjs_schedule_gc_if_needed(context);
if (JS_GetPendingException(context, &result)) {
- str = JS_ValueToString(context, result);
+ str = JS::ToString(context, result);
JS_ClearPendingException(context);
} else if (result.isUndefined()) {
goto next;
} else {
- str = JS_ValueToString(context, result);
+ str = JS::ToString(context, result);
}
if (str) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]