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-07-27 22:37:30 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
164
void Enable(const FunctionCallbackInfo<Value>& args) {
16
164
  Environment* env = Environment::GetCurrent(args);
17
18
328
  CHECK(args[0]->IsFunction());
19
20
328
  env->set_domain_callback(args[0].As<Function>());
21
164
}
22
23
164
void Initialize(Local<Object> target,
24
                Local<Value> unused,
25
                Local<Context> context,
26
                void* priv) {
27
164
  Environment* env = Environment::GetCurrent(context);
28
29
164
  env->SetMethod(target, "enable", Enable);
30
164
}
31
32
}  // namespace domain
33
}  // namespace node
34
35
4831
NODE_MODULE_CONTEXT_AWARE_INTERNAL(domain, node::domain::Initialize)