GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_config.cc Lines: 13 13 100.0 %
Date: 2019-03-02 22:23:06 Branches: 0 0 - %

Line Branch Exec Source
1
#include "env-inl.h"
2
#include "node.h"
3
#include "node_i18n.h"
4
#include "node_options-inl.h"
5
#include "util-inl.h"
6
7
namespace node {
8
9
using v8::Context;
10
using v8::Isolate;
11
using v8::Local;
12
using v8::Number;
13
using v8::Object;
14
using v8::Value;
15
16
// The config binding is used to provide an internal view of compile or runtime
17
// config options that are required internally by lib/*.js code. This is an
18
// alternative to dropping additional properties onto the process object as
19
// has been the practice previously in node.cc.
20
21
4413
static void Initialize(Local<Object> target,
22
                       Local<Value> unused,
23
                       Local<Context> context) {
24
4413
  Environment* env = Environment::GetCurrent(context);
25
4413
  Isolate* isolate = env->isolate();
26
27
#if defined(DEBUG) && DEBUG
28
  READONLY_TRUE_PROPERTY(target, "isDebugBuild");
29
#else
30
13239
  READONLY_FALSE_PROPERTY(target, "isDebugBuild");
31
#endif  // defined(DEBUG) && DEBUG
32
33
#if HAVE_OPENSSL
34
13239
  READONLY_TRUE_PROPERTY(target, "hasOpenSSL");
35
#else
36
  READONLY_FALSE_PROPERTY(target, "hasOpenSSL");
37
#endif  // HAVE_OPENSSL
38
39
#ifdef NODE_FIPS_MODE
40
  READONLY_TRUE_PROPERTY(target, "fipsMode");
41
#endif
42
43
#ifdef NODE_HAVE_I18N_SUPPORT
44
45
13239
  READONLY_TRUE_PROPERTY(target, "hasIntl");
46
47
#ifdef NODE_HAVE_SMALL_ICU
48
13239
  READONLY_TRUE_PROPERTY(target, "hasSmallICU");
49
#endif  // NODE_HAVE_SMALL_ICU
50
51
#if NODE_USE_V8_PLATFORM
52
13239
  READONLY_TRUE_PROPERTY(target, "hasTracing");
53
#endif
54
55
#if !defined(NODE_WITHOUT_NODE_OPTIONS)
56
13239
  READONLY_TRUE_PROPERTY(target, "hasNodeOptions");
57
#endif
58
59
#endif  // NODE_HAVE_I18N_SUPPORT
60
61
#if HAVE_INSPECTOR
62
13239
  READONLY_TRUE_PROPERTY(target, "hasInspector");
63
#else
64
  READONLY_FALSE_PROPERTY(target, "hasInspector");
65
#endif
66
67
17652
  READONLY_PROPERTY(target,
68
                    "bits",
69
                    Number::New(env->isolate(), 8 * sizeof(intptr_t)));
70
4413
}  // InitConfig
71
72
}  // namespace node
73
74
4292
NODE_MODULE_CONTEXT_AWARE_INTERNAL(config, node::Initialize)