LCOV - code coverage report
Current view: top level - gi - cwrapper.cpp (source / functions) Coverage Total Hit
Test: gjs- Code Coverage Lines: 87.5 % 8 7
Test Date: 2025-01-18 18:34:07 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 50.0 % 2 1

             Branch data     Line data    Source code
       1                 :             : /* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
       2                 :             : // SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
       3                 :             : // SPDX-FileCopyrightText: 2012 Red Hat, Inc.
       4                 :             : 
       5                 :             : #include <config.h>
       6                 :             : 
       7                 :             : #include <glib-object.h>
       8                 :             : 
       9                 :             : #include <js/PropertyDescriptor.h>  // for JSPROP_PERMANENT
      10                 :             : #include <js/RootingAPI.h>
      11                 :             : #include <js/TypeDecls.h>
      12                 :             : 
      13                 :             : #include "gi/cwrapper.h"
      14                 :             : #include "gi/gtype.h"
      15                 :             : #include "gjs/atoms.h"
      16                 :             : #include "gjs/context-private.h"
      17                 :             : 
      18                 :        1868 : bool gjs_wrapper_define_gtype_prop(JSContext* cx, JS::HandleObject constructor,
      19                 :             :                                    GType gtype) {
      20                 :        1868 :     JS::RootedObject gtype_obj(cx, gjs_gtype_create_gtype_wrapper(cx, gtype));
      21         [ -  + ]:        1868 :     if (!gtype_obj)
      22                 :           0 :         return false;
      23                 :             : 
      24                 :        1868 :     const GjsAtoms& atoms = GjsContextPrivate::atoms(cx);
      25                 :        3736 :     return JS_DefinePropertyById(cx, constructor, atoms.gtype(), gtype_obj,
      26                 :        1868 :                                  JSPROP_PERMANENT);
      27                 :        1868 : }
        

Generated by: LCOV version 2.0-1