[gjs/wip/js17: 11/14] Add wrappers for removed api, JS_NewNumberValue and JSVAL_IS_OBJECT()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/js17: 11/14] Add wrappers for removed api, JS_NewNumberValue and JSVAL_IS_OBJECT()
- Date: Sun, 24 Mar 2013 13:28:31 +0000 (UTC)
commit 7c7c667e49d750b8225d4fb7471d01d2d978ef7a
Author: Tim Lunn <tim feathertop org>
Date: Thu Jan 10 13:30:00 2013 +1100
Add wrappers for removed api, JS_NewNumberValue and JSVAL_IS_OBJECT()
Both these api are deprecated and removed. For now add wrappers to compat.h that
provide equivalent functionality.
https://bugzilla.gnome.org/show_bug.cgi?id=690982
gjs/compat.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gjs/compat.h b/gjs/compat.h
index f5e9634..af8e317 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -45,6 +45,16 @@ G_BEGIN_DECLS
* See https://bugzilla.gnome.org/show_bug.cgi?id=622896 for some initial discussion.
*/
+#define JSVAL_IS_OBJECT(obj) (JSVAL_IS_NULL(obj) || !JSVAL_IS_PRIMITIVE(obj))
+
+static JSBool JS_NewNumberValue(JSContext *cx, double d, jsval *rval)
+ {
+ *rval = JS_NumberValue(d);
+ if (JSVAL_IS_NUMBER(*rval))
+ return JS_TRUE;
+ return JS_FALSE;
+ }
+
/**
* GJS_NATIVE_CONSTRUCTOR_DECLARE:
* Prototype a constructor.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]