GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/module_wrap.h Lines: 7 7 100.0 %
Date: 2020-05-27 22:15:15 Branches: 0 0 - %

Line Branch Exec Source
1
#ifndef SRC_MODULE_WRAP_H_
2
#define SRC_MODULE_WRAP_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include <unordered_map>
7
#include <string>
8
#include <vector>
9
#include "base_object.h"
10
11
namespace node {
12
13
class Environment;
14
15
namespace loader {
16
17
enum ScriptType : int {
18
  kScript,
19
  kModule,
20
  kFunction,
21
};
22
23
enum HostDefinedOptions : int {
24
  kType = 8,
25
  kID = 9,
26
  kLength = 10,
27
};
28
29
class ModuleWrap : public BaseObject {
30
 public:
31
  static void Initialize(v8::Local<v8::Object> target,
32
                         v8::Local<v8::Value> unused,
33
                         v8::Local<v8::Context> context,
34
                         void* priv);
35
  static void HostInitializeImportMetaObjectCallback(
36
      v8::Local<v8::Context> context,
37
      v8::Local<v8::Module> module,
38
      v8::Local<v8::Object> meta);
39
40
166
  void MemoryInfo(MemoryTracker* tracker) const override {
41
166
    tracker->TrackField("url", url_);
42
166
    tracker->TrackField("resolve_cache", resolve_cache_);
43
166
  }
44
45
30785
  inline uint32_t id() { return id_; }
46
  static ModuleWrap* GetFromID(node::Environment*, uint32_t id);
47
48
166
  SET_MEMORY_INFO_NAME(ModuleWrap)
49
166
  SET_SELF_SIZE(ModuleWrap)
50
51
 private:
52
  ModuleWrap(Environment* env,
53
             v8::Local<v8::Object> object,
54
             v8::Local<v8::Module> module,
55
             v8::Local<v8::String> url);
56
  ~ModuleWrap() override;
57
58
  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
59
  static void Link(const v8::FunctionCallbackInfo<v8::Value>& args);
60
  static void Instantiate(const v8::FunctionCallbackInfo<v8::Value>& args);
61
  static void Evaluate(const v8::FunctionCallbackInfo<v8::Value>& args);
62
  static void GetNamespace(const v8::FunctionCallbackInfo<v8::Value>& args);
63
  static void GetStatus(const v8::FunctionCallbackInfo<v8::Value>& args);
64
  static void GetError(const v8::FunctionCallbackInfo<v8::Value>& args);
65
  static void GetStaticDependencySpecifiers(
66
      const v8::FunctionCallbackInfo<v8::Value>& args);
67
68
  static void SetImportModuleDynamicallyCallback(
69
      const v8::FunctionCallbackInfo<v8::Value>& args);
70
  static void SetInitializeImportMetaObjectCallback(
71
      const v8::FunctionCallbackInfo<v8::Value>& args);
72
  static v8::MaybeLocal<v8::Value> SyntheticModuleEvaluationStepsCallback(
73
      v8::Local<v8::Context> context, v8::Local<v8::Module> module);
74
  static void SetSyntheticExport(
75
      const v8::FunctionCallbackInfo<v8::Value>& args);
76
  static void CreateCachedData(const v8::FunctionCallbackInfo<v8::Value>& args);
77
78
  static v8::MaybeLocal<v8::Module> ResolveCallback(
79
      v8::Local<v8::Context> context,
80
      v8::Local<v8::String> specifier,
81
      v8::Local<v8::Module> referrer);
82
  static ModuleWrap* GetFromModule(node::Environment*, v8::Local<v8::Module>);
83
84
  v8::Global<v8::Function> synthetic_evaluation_steps_;
85
  bool synthetic_ = false;
86
  v8::Global<v8::Module> module_;
87
  v8::Global<v8::String> url_;
88
  bool linked_ = false;
89
  std::unordered_map<std::string, v8::Global<v8::Promise>> resolve_cache_;
90
  v8::Global<v8::Context> context_;
91
  uint32_t id_;
92
};
93
94
}  // namespace loader
95
}  // namespace node
96
97
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
98
99
#endif  // SRC_MODULE_WRAP_H_