[gjs/wip/ptomato/mozjs52: 6/9] js: Adapt to options changes



commit 2fe1b9d2accbc8fbae3ea7fcd81d1568f8579432
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.)

 gjs/coverage.cpp   |    2 +-
 gjs/jsapi-util.cpp |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index 85777bb..f0fba85 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1593,7 +1593,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,
         JS_NewGlobalObject(context, &coverage_global_class, NULL,
                            JS::FireOnNewGlobalHook, options));
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index a8461a0..83df12e 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -94,17 +94,17 @@ gjs_init_context_standard (JSContext              *context,
      * setExtraWarnings: Report warnings to error reporter function.
      */
     JS::ContextOptionsRef(context).setDontReportUncaught(true);
-    JS::RuntimeOptionsRef(context).setExtraWarnings(extra_warnings);
+    JS::ContextOptionsRef(context).setExtraWarnings(extra_warnings);
 
     if (!g_getenv("GJS_DISABLE_JIT")) {
         gjs_debug(GJS_DEBUG_CONTEXT, "Enabling JIT");
-        JS::RuntimeOptionsRef(context)
+        JS::ContextOptionsRef(context)
             .setIon(true)
             .setBaseline(true)
             .setAsmJS(true);
     }
 
-    compartment_options.setVersion(JSVERSION_LATEST);
+    compartment_options.behaviors().setVersion(JSVERSION_LATEST);
     global.set(JS_NewGlobalObject(context, &global_class, NULL,
                                   JS::FireOnNewGlobalHook, compartment_options));
     if (global == NULL)


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