[gjs] fundamental: assert that priv is not NULL if we are on the right JSClass



commit 9680de88d444d6b7f5eb289f4c92f22c79e8b267
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Feb 24 13:47:49 2014 +0100

    fundamental: assert that priv is not NULL if we are on the right JSClass
    
    We don't have custom inheritance for fundamental types, so we don't
    need to run JS code before the C object is constructed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725061

 gi/fundamental.cpp |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index a3c3a2f..1cb2a19 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -896,16 +896,7 @@ gjs_typecheck_fundamental(JSContext *context,
         return JS_FALSE;
 
     priv = priv_from_js(context, object);
-
-    if (priv == NULL) {
-        if (throw_error) {
-            gjs_throw(context,
-                      "Fundamental instance or prototype has not been properly initialized yet. "
-                      "Did you forget to chain-up from _init()?");
-        }
-
-        return JS_FALSE;
-    }
+    g_assert(priv != NULL);
 
     if (priv->gfundamental == NULL) {
         if (throw_error) {


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