[gjs/wip/ptomato/mozjs52: 18/37] js: Various API changes for SpiderMonkey 45



commit 8fd1103969253ba3791eac0e439eb331001a8a98
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Mar 19 08:02:23 2017 +0000

    js: Various API changes for SpiderMonkey 45
    
    A few minor changes that were only in one place.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784196

 gjs/global.cpp                  |    2 +-
 gjs/jsapi-constructor-proxy.cpp |   10 +++++-----
 modules/system.cpp              |    5 ++++-
 3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gjs/global.cpp b/gjs/global.cpp
index c9ba259..bb0f7b6 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -251,7 +251,7 @@ public:
         JSAutoCompartment ac(cx, global);
 
         if (!JS_InitStandardClasses(cx, global) ||
-            !JS_InitReflect(cx, global) ||
+            !JS_InitReflectParse(cx, global) ||
             !JS_DefineDebuggerObject(cx, global))
             return nullptr;
 
diff --git a/gjs/jsapi-constructor-proxy.cpp b/gjs/jsapi-constructor-proxy.cpp
index 6bb59b2..25c0ba3 100644
--- a/gjs/jsapi-constructor-proxy.cpp
+++ b/gjs/jsapi-constructor-proxy.cpp
@@ -45,7 +45,7 @@
  * getPrototypeOf() trap, which may or may not be turned on in JS proxies,
  * I'm not sure.
  *
- * COMPAT: SpiderMonkey doesn't support the getPrototypeOf() trap in JS
+ * COMPAT: SpiderMonkey doesn't support the getPrototype() trap in JS
  * proxies yet. That has yet to be released, in the upcoming SpiderMonkey 52.
  * When that is available, then this whole file can be discontinued.
  *
@@ -87,9 +87,9 @@ public:
     { }
 
     bool
-    getPrototypeOf(JSContext              *cx,
-                   JS::HandleObject        proxy,
-                   JS::MutableHandleObject proto_p)
+    getPrototype(JSContext              *cx,
+                 JS::HandleObject        proxy,
+                 JS::MutableHandleObject proto_p)
     const override
     {
         proto_p.set(proto(proxy));
@@ -155,7 +155,7 @@ create_gjs_constructor_proxy(JSContext *cx,
 
     JS::RootedObject proxy(cx,
         js::NewProxyObject(cx, &GjsConstructorHandler::singleton(), args[0],
-                           &args[1].toObject(), nullptr));
+                           &args[1].toObject()));
     /* We stick this extra object into one of the proxy object's "extra slots",
      * even though it is private data of the proxy handler. This is because
      * proxy handlers cannot have trace callbacks. The proxy object does have a
diff --git a/modules/system.cpp b/modules/system.cpp
index dc993d5..137b49c 100644
--- a/modules/system.cpp
+++ b/modules/system.cpp
@@ -27,6 +27,9 @@
 #include <sys/types.h>
 #include <time.h>
 
+#include "gjs/jsapi-wrapper.h"
+#include <js/Date.h>
+
 #include <gjs/context.h>
 
 #include "gi/object.h"
@@ -161,7 +164,7 @@ gjs_clear_date_caches(JSContext *context,
     // localtime_r, see https://bugzilla.mozilla.org/show_bug.cgi?id=1004706
     tzset();
 
-    JS_ClearDateCaches(context);
+    JS::ResetTimeZone();
     JS_EndRequest(context);
 
     rec.rval().setUndefined();


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