[gjs/wip/js24] JS_EncodeStringToBuffer, add context as first argument.
- From: Tim Lunn <timl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/js24] JS_EncodeStringToBuffer, add context as first argument.
- Date: Wed, 2 Oct 2013 21:04:53 +0000 (UTC)
commit 0309d4637294d46faa4a8b1af6655fbd4b59649c
Author: Tim Lunn <tim feathertop org>
Date: Sat Sep 28 11:13:21 2013 +1000
JS_EncodeStringToBuffer, add context as first argument.
gjs/context.cpp | 4 ++--
gjs/jsapi-util-string.cpp | 2 +-
gjs/jsapi-util.cpp | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index f81600d..de35c69 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -564,7 +564,7 @@ gjs_context_constructor (GType type,
js_context = GJS_CONTEXT(object);
- js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */);
+ js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */, JS_NO_HELPER_THREADS);
JS_SetNativeStackQuota(js_context->runtime, 1024*1024);
if (js_context->runtime == NULL)
g_error("Failed to create javascript runtime");
@@ -615,7 +615,7 @@ gjs_context_constructor (GType type,
JS_VersionToString(js_version),
JS_VersionToString(JS_GetVersion(js_context->context)));
- JS_SetVersion(js_context->context, js_version);
+ //JS_SetVersion(js_context->context, js_version);
}
if (!gjs_init_context_standard(js_context->context))
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index d4b96d0..af58564 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -56,7 +56,7 @@ gjs_string_to_utf8 (JSContext *context,
if (utf8_string_p) {
bytes = (char*) g_malloc((len + 1) * sizeof(char));
- JS_EncodeStringToBuffer(str, bytes, len);
+ JS_EncodeStringToBuffer(context, str, bytes, len);
bytes[len] = '\0';
*utf8_string_p = bytes;
}
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index d871352..6007694 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -337,7 +337,7 @@ gjs_value_debug_string(JSContext *context,
size_t len = JS_GetStringEncodingLength(context, str);
if (len != (size_t)(-1)) {
bytes = (char*) g_malloc((len + 1) * sizeof(char));
- JS_EncodeStringToBuffer(str, bytes, len);
+ JS_EncodeStringToBuffer(context, str, bytes, len);
bytes[len] = '\0';
} else {
bytes = g_strdup("[invalid string]");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]