GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_domain.cc Lines: 10 10 100.0 %
Date: 2019-09-23 22:30:09 Branches: 1 2 50.0 %

Line Branch Exec Source
1
#include "env-inl.h"
2
#include "v8.h"
3
4
namespace node {
5
namespace domain {
6
7
using v8::Context;
8
using v8::Function;
9
using v8::FunctionCallbackInfo;
10
using v8::Local;
11
using v8::Object;
12
using v8::Value;
13
14
15
165
void Enable(const FunctionCallbackInfo<Value>& args) {
16
165
  Environment* env = Environment::GetCurrent(args);
17
18
330
  CHECK(args[0]->IsFunction());
19
20
330
  env->set_domain_callback(args[0].As<Function>());
21
165
}
22
23
165
void Initialize(Local<Object> target,
24
                Local<Value> unused,
25
                Local<Context> context,
26
                void* priv) {
27
165
  Environment* env = Environment::GetCurrent(context);
28
29
165
  env->SetMethod(target, "enable", Enable);
30
165
}
31
32
}  // namespace domain
33
}  // namespace node
34
35
5047
NODE_MODULE_CONTEXT_AWARE_INTERNAL(domain, node::domain::Initialize)