[gjs: 1/2] global: Enable class fields.



commit ca9b8c5e2c21e1760e28aa2a8e690df6ee8d9227
Author: Evan Welsh <noreply evanwelsh com>
Date:   Sat Apr 11 06:57:59 2020 -0500

    global: Enable class fields.

 gjs/global.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gjs/global.cpp b/gjs/global.cpp
index 517737b8..dd2ad2a9 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -248,8 +248,14 @@ class GjsGlobal {
     static JSObject *
     create(JSContext *cx)
     {
-        JS::RealmOptions options;
-        options.creationOptions().setBigIntEnabled(true);
+        JS::RealmBehaviors behaviors;
+
+        JS::RealmCreationOptions creation;
+        creation.setFieldsEnabled(true);
+        creation.setBigIntEnabled(true);
+
+        JS::RealmOptions options(creation, behaviors);
+
         JS::RootedObject global(
             cx, JS_NewGlobalObject(cx, &GjsGlobal::klass, nullptr,
                                    JS::FireOnNewGlobalHook, options));


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