[gjs/native-registry: 7/8] Assert when trying to define properties on wrong global type




commit 3c3592f90a24c55c6d4af9491d27f81e5453367f
Author: Evan Welsh <contact evanwelsh com>
Date:   Fri Oct 16 18:25:00 2020 -0500

    Assert when trying to define properties on wrong global type

 gjs/global.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gjs/global.cpp b/gjs/global.cpp
index 28d569b1..8b96b8dc 100644
--- a/gjs/global.cpp
+++ b/gjs/global.cpp
@@ -343,9 +343,10 @@ bool gjs_define_global_properties(JSContext* cx, JS::HandleObject global,
         case GjsGlobalType::DEBUGGER:
             return GjsDebuggerGlobal::define_properties(cx, global, realm_name,
                                                         bootstrap_script);
-        default:
-            return true;
     }
+
+    // Global type does not handle define_properties
+    g_assert_not_reached();
 }
 
 void detail::set_global_slot(JSObject* global, uint32_t slot, JS::Value value) {


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