GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: node_api_internals.h Lines: 3 3 100.0 %
Date: 2022-06-18 04:16:12 Branches: 0 0 - %

Line Branch Exec Source
1
#ifndef SRC_NODE_API_INTERNALS_H_
2
#define SRC_NODE_API_INTERNALS_H_
3
4
#include "v8.h"
5
#define NAPI_EXPERIMENTAL
6
#include "env-inl.h"
7
#include "js_native_api_v8.h"
8
#include "node_api.h"
9
#include "util-inl.h"
10
11
struct node_napi_env__ : public napi_env__ {
12
  node_napi_env__(v8::Local<v8::Context> context,
13
                  const std::string& module_filename);
14
  ~node_napi_env__();
15
16
  bool can_call_into_js() const override;
17
  v8::Maybe<bool> mark_arraybuffer_as_untransferable(
18
      v8::Local<v8::ArrayBuffer> ab) const override;
19
  void CallFinalizer(napi_finalize cb, void* data, void* hint) override;
20
  template <bool enforceUncaughtExceptionPolicy>
21
  void CallFinalizer(napi_finalize cb, void* data, void* hint);
22
23
  void trigger_fatal_exception(v8::Local<v8::Value> local_err);
24
  template <bool enforceUncaughtExceptionPolicy, typename T>
25
  void CallbackIntoModule(T&& call);
26
27
122192
  inline node::Environment* node_env() const {
28
122192
    return node::Environment::GetCurrent(context());
29
  }
30
2
  inline const char* GetFilename() const { return filename.c_str(); }
31
32
  std::string filename;
33
  bool destructing = false;
34
};
35
36
using node_napi_env = node_napi_env__*;
37
38
#endif  // SRC_NODE_API_INTERNALS_H_