LCOV - code coverage report
Current view: top level - gjs - jsapi-class.h (source / functions) Coverage Total Hit
Test: gjs- Code Coverage Lines: 100.0 % 3 3
Test Date: 2024-04-20 17:42:51 Functions: 100.0 % 1 1
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: - 0 0

             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: 2017 Philip Chimento
       4                 :             : 
       5                 :             : #ifndef GJS_JSAPI_CLASS_H_
       6                 :             : #define GJS_JSAPI_CLASS_H_
       7                 :             : 
       8                 :             : #include <config.h>
       9                 :             : 
      10                 :             : #include <glib-object.h>
      11                 :             : #include <glib.h>
      12                 :             : 
      13                 :             : #include <js/CallArgs.h>  // for JSNative
      14                 :             : #include <js/TypeDecls.h>
      15                 :             : #include <js/ValueArray.h>
      16                 :             : 
      17                 :             : #include "gjs/global.h"
      18                 :             : #include "gjs/jsapi-util.h"
      19                 :             : #include "gjs/macros.h"
      20                 :             : 
      21                 :             : GJS_JSAPI_RETURN_CONVENTION
      22                 :             : bool gjs_init_class_dynamic(
      23                 :             :     JSContext* cx, JS::HandleObject in_object, JS::HandleObject parent_proto,
      24                 :             :     const char* ns_name, const char* class_name, const JSClass* clasp,
      25                 :             :     JSNative constructor_native, unsigned nargs, JSPropertySpec* ps,
      26                 :             :     JSFunctionSpec* fs, JSPropertySpec* static_ps, JSFunctionSpec* static_fs,
      27                 :             :     JS::MutableHandleObject prototype, JS::MutableHandleObject constructor);
      28                 :             : 
      29                 :             : [[nodiscard]] bool gjs_typecheck_instance(JSContext* cx, JS::HandleObject obj,
      30                 :             :                                           const JSClass* static_clasp,
      31                 :             :                                           bool throw_error);
      32                 :             : 
      33                 :             : GJS_JSAPI_RETURN_CONVENTION
      34                 :             : JSObject *gjs_construct_object_dynamic(JSContext                  *cx,
      35                 :             :                                        JS::HandleObject            proto,
      36                 :             :                                        const JS::HandleValueArray& args);
      37                 :             : 
      38                 :             : GJS_JSAPI_RETURN_CONVENTION
      39                 :             : bool gjs_define_property_dynamic(JSContext*, JS::HandleObject proto,
      40                 :             :                                  const char* prop_name, JS::HandleId,
      41                 :             :                                  const char* func_namespace, JSNative getter,
      42                 :             :                                  JS::HandleValue getter_slot, JSNative setter,
      43                 :             :                                  JS::HandleValue setter_slot, unsigned flags);
      44                 :             : 
      45                 :             : GJS_JSAPI_RETURN_CONVENTION
      46                 :        1638 : inline bool gjs_define_property_dynamic(JSContext* cx, JS::HandleObject proto,
      47                 :             :                                         const char* prop_name, JS::HandleId id,
      48                 :             :                                         const char* func_namespace,
      49                 :             :                                         JSNative getter, JSNative setter,
      50                 :             :                                         JS::HandleValue private_slot,
      51                 :             :                                         unsigned flags) {
      52                 :        1638 :     return gjs_define_property_dynamic(cx, proto, prop_name, id, func_namespace,
      53                 :             :                                        getter, private_slot, setter,
      54                 :        1638 :                                        private_slot, flags);
      55                 :             : }
      56                 :             : 
      57                 :             : [[nodiscard]] JS::Value gjs_dynamic_property_private_slot(
      58                 :             :     JSObject* accessor_obj);
      59                 :             : 
      60                 :             : GJS_JSAPI_RETURN_CONVENTION
      61                 :             : bool gjs_object_in_prototype_chain(JSContext* cx, JS::HandleObject proto,
      62                 :             :                                    JS::HandleObject check_obj,
      63                 :             :                                    bool* is_in_chain);
      64                 :             : 
      65                 :             : #endif  // GJS_JSAPI_CLASS_H_
        

Generated by: LCOV version 2.0-1