[gjs/wip/ptomato/mozjs52: 28/37] js: Adapt to options changes



commit de7ee90908740ae8f46d8008f60ae7fe60f9d222
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue May 2 22:29:33 2017 -0700

    js: Adapt to options changes
    
    JS::RuntimeOptions and JS::ContextOptions have merged into one
    JS::ContextOptions class. JS::CompartmentOptions, on the other hand, has
    split into "creation options" (can be set only at construct time) and
    "behaviors" (can be changed at run time.)
    
    The DontReportUncaught option is removed and is now activated
    unconditionally.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784196

 gjs/context.cpp  |    8 ++------
 gjs/coverage.cpp |    2 +-
 gjs/global.cpp   |    2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 6f8967b..899d58e 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -308,21 +308,17 @@ gjs_context_constructed(GObject *object)
     /* setExtraWarnings: Be extra strict about code that might hide a bug */
     if (!g_getenv("GJS_DISABLE_EXTRA_WARNINGS")) {
         gjs_debug(GJS_DEBUG_CONTEXT, "Enabling extra warnings");
-        JS::RuntimeOptionsRef(js_context->context).setExtraWarnings(true);
+        JS::ContextOptionsRef(js_context->context).setExtraWarnings(true);
     }
 
     if (!g_getenv("GJS_DISABLE_JIT")) {
         gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT");
-        JS::RuntimeOptionsRef(js_context->context)
+        JS::ContextOptionsRef(js_context->context)
             .setIon(true)
             .setBaseline(true)
             .setAsmJS(true);
     }
 
-    /* setDontReportUncaught: Don't send exceptions to our error report handler;
-     * instead leave them set. This allows us to get at the exception object. */
-    JS::ContextOptionsRef(js_context->context).setDontReportUncaught(true);
-
     JS::RootedObject global(js_context->context,
         gjs_create_global_object(js_context->context));
     if (!global) {
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 54326c4..b5d1324 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1553,7 +1553,7 @@ bootstrap_coverage(GjsCoverage *coverage)
 
     JSObject *debuggee = gjs_get_import_global(context);
     JS::CompartmentOptions options;
-    options.setVersion(JSVERSION_LATEST);
+    options.behaviors().setVersion(JSVERSION_LATEST);
     JS::RootedObject debugger_compartment(context,
                                           gjs_create_global_object(context));
     {
diff --git a/gjs/global.cpp b/gjs/global.cpp
index bbf30bf..963aa53 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -245,7 +245,7 @@ public:
     create(JSContext *cx)
     {
         JS::CompartmentOptions compartment_options;
-        compartment_options.setVersion(JSVERSION_LATEST);
+        compartment_options.behaviors().setVersion(JSVERSION_LATEST);
         JS::RootedObject global(cx,
             JS_NewGlobalObject(cx, &GjsGlobal::klass, nullptr,
                                JS::FireOnNewGlobalHook, compartment_options));


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