GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: node_api_internals.h Lines: 3 3 100.0 %
Date: 2021-09-15 04:12:31 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
15
  bool can_call_into_js() const override;
16
  v8::Maybe<bool> mark_arraybuffer_as_untransferable(
17
      v8::Local<v8::ArrayBuffer> ab) const override;
18
  void CallFinalizer(napi_finalize cb, void* data, void* hint) override;
19
20
122142
  inline node::Environment* node_env() const {
21
122142
    return node::Environment::GetCurrent(context());
22
  }
23
1
  inline const char* GetFilename() const { return filename.c_str(); }
24
25
  std::string filename;
26
};
27
28
using node_napi_env = node_napi_env__*;
29
30
#endif  // SRC_NODE_API_INTERNALS_H_