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: 2020-08-07 22:13:19 Branches: 2 4 50.0 %

Line Branch Exec Source
1
#include "env-inl.h"
2
#include "memory_tracker.h"
3
#include "node.h"
4
#include "node_i18n.h"
5
#include "node_native_module_env.h"
6
#include "node_options.h"
7
#include "util-inl.h"
8
9
namespace node {
10
11
using v8::Context;
12
using v8::Isolate;
13
using v8::Local;
14
using v8::Number;
15
using v8::Object;
16
using v8::Value;
17
18
// The config binding is used to provide an internal view of compile time
19
// config options that are required internally by lib/*.js code. This is an
20
// alternative to dropping additional properties onto the process object as
21
// has been the practice previously in node.cc.
22
23
// Command line arguments are already accessible in the JS land via
24
// require('internal/options').getOptionValue('--some-option'). Do not add them
25
// here.
26
389
static void Initialize(Local<Object> target,
27
                       Local<Value> unused,
28
                       Local<Context> context,
29
                       void* priv) {
30
389
  Environment* env = Environment::GetCurrent(context);
31
389
  Isolate* isolate = env->isolate();
32
33
#if defined(DEBUG) && DEBUG
34
  READONLY_TRUE_PROPERTY(target, "isDebugBuild");
35
#else
36
1167
  READONLY_FALSE_PROPERTY(target, "isDebugBuild");
37
#endif  // defined(DEBUG) && DEBUG
38
39
#if HAVE_OPENSSL
40
1167
  READONLY_TRUE_PROPERTY(target, "hasOpenSSL");
41
#else
42
  READONLY_FALSE_PROPERTY(target, "hasOpenSSL");
43
#endif  // HAVE_OPENSSL
44
45
#ifdef NODE_FIPS_MODE
46
  READONLY_TRUE_PROPERTY(target, "fipsMode");
47
#endif
48
49
#ifdef NODE_HAVE_I18N_SUPPORT
50
51
1167
  READONLY_TRUE_PROPERTY(target, "hasIntl");
52
53
#ifdef NODE_HAVE_SMALL_ICU
54
  READONLY_TRUE_PROPERTY(target, "hasSmallICU");
55
#endif  // NODE_HAVE_SMALL_ICU
56
57
#if NODE_USE_V8_PLATFORM
58
1167
  READONLY_TRUE_PROPERTY(target, "hasTracing");
59
#endif
60
61
#if !defined(NODE_WITHOUT_NODE_OPTIONS)
62
1167
  READONLY_TRUE_PROPERTY(target, "hasNodeOptions");
63
#endif
64
65
#endif  // NODE_HAVE_I18N_SUPPORT
66
67
#if HAVE_INSPECTOR
68
1167
  READONLY_TRUE_PROPERTY(target, "hasInspector");
69
#else
70
  READONLY_FALSE_PROPERTY(target, "hasInspector");
71
#endif
72
73
// configure --no-browser-globals
74
#ifdef NODE_NO_BROWSER_GLOBALS
75
  READONLY_TRUE_PROPERTY(target, "noBrowserGlobals");
76
#else
77
1167
  READONLY_FALSE_PROPERTY(target, "noBrowserGlobals");
78
#endif  // NODE_NO_BROWSER_GLOBALS
79
80
1556
  READONLY_PROPERTY(target,
81
                    "bits",
82
                    Number::New(isolate, 8 * sizeof(intptr_t)));
83
84
#if defined HAVE_DTRACE || defined HAVE_ETW
85
  READONLY_TRUE_PROPERTY(target, "hasDtrace");
86
#endif
87
389
}  // InitConfig
88
89
}  // namespace node
90
91

17763
NODE_MODULE_CONTEXT_AWARE_INTERNAL(config, node::Initialize)