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: 15 15 100.0 %
Date: 2019-05-05 22:32:45 Branches: 0 0 - %

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