[gjs] jsapi-constructor-proxy: Inherit from js::Wrapper



commit 0982d99c332c1cb6bb819d992b1d17ba7902c4cd
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue May 2 21:26:09 2017 -0700

    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

 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 0a2569c..6bb59b2 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]