diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2017-05-02 21:26:09 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2017-05-05 23:21:28 -0700 |
commit | 0982d99c332c1cb6bb819d992b1d17ba7902c4cd (patch) | |
tree | b087ea1736cd4154d01da29a126eb1d1371f0746 | |
parent | 9aa41162dca48036abb51370fa2d2b63e7397447 (diff) | |
download | gjs-0982d99c332c1cb6bb819d992b1d17ba7902c4cd.tar.gz |
jsapi-constructor-proxy: Inherit from js::Wrapper
js::DirectProxyHandler and js::Wrapper are supposedly the same, except
that js::Wrapper can expose the object it's wrapping to C++ code. We don't
use that functionality. However, js::DirectProxyHandler is being removed
in SpiderMonkey 52 in favour of js::Wrapper, so it makes sense to switch.
https://bugzilla.gnome.org/show_bug.cgi?id=781429
-rw-r--r-- | gjs/jsapi-constructor-proxy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gjs/jsapi-constructor-proxy.cpp b/gjs/jsapi-constructor-proxy.cpp index 0a2569c5..6bb59b25 100644 --- a/gjs/jsapi-constructor-proxy.cpp +++ b/gjs/jsapi-constructor-proxy.cpp @@ -23,9 +23,11 @@ * Authored by: Philip Chimento <philip@endlessm.com> */ +#include "jsapi-wrapper.h" +#include <jswrapper.h> + #include "jsapi-constructor-proxy.h" #include "jsapi-util.h" -#include "jsapi-wrapper.h" #include "mem.h" #include "util/log.h" @@ -64,8 +66,6 @@ */ static const char constructor_proxy_create_name[] = "__private_GjsConstructorProxy"; -/* This char's address is an arbitrary identifier for use in debugging */ -static const char constructor_proxy_family = 'p'; enum { SLOT_PROTO, @@ -74,7 +74,7 @@ enum { /* This class is the C++ equivalent of a proxy handler object. In JS, that is * the second argument passed to the "new Proxy(target, handler)" constructor. */ -class GjsConstructorHandler : public js::DirectProxyHandler { +class GjsConstructorHandler : public js::Wrapper { static inline JSObject * proto(JS::HandleObject proxy) { @@ -83,7 +83,7 @@ class GjsConstructorHandler : public js::DirectProxyHandler { public: GjsConstructorHandler() - : js::DirectProxyHandler(&constructor_proxy_family, true /* hasPrototype */) + : js::Wrapper(0 /* flags */, true /* hasPrototype */) { } bool |