GeezerVison is showing github.com — src: initialize encoding_ data member · nodejs/node@3b1c19f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/fs_event_wrap.cc +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,25 +34,25 @@ class FSEventWrap: public HandleWrap { |
34 | 34 | size_t self_size() const override { return sizeof(*this); } |
35 | 35 |
|
36 | 36 | private: |
| 37 | + static const encoding kDefaultEncoding = UTF8; |
| 38 | + |
37 | 39 | FSEventWrap(Environment* env, Local<Object> object); |
38 | 40 | ~FSEventWrap() override; |
39 | 41 |
|
40 | 42 | static void OnEvent(uv_fs_event_t* handle, const char* filename, int events, |
41 | 43 | int status); |
42 | 44 |
|
43 | 45 | uv_fs_event_t handle_; |
44 | | - bool initialized_; |
45 | | - enum encoding encoding_; |
| 46 | + bool initialized_ = false; |
| 47 | + enum encoding encoding_ = kDefaultEncoding; |
46 | 48 | }; |
47 | 49 |
|
48 | 50 |
|
49 | 51 | FSEventWrap::FSEventWrap(Environment* env, Local<Object> object) |
50 | 52 | : HandleWrap(env, |
51 | 53 | object, |
52 | 54 | reinterpret_cast<uv_handle_t*>(&handle_), |
53 | | - AsyncWrap::PROVIDER_FSEVENTWRAP) { |
54 | | - initialized_ = false; |
55 | | -} |
| 55 | + AsyncWrap::PROVIDER_FSEVENTWRAP) {} |
56 | 56 |
|
57 | 57 |
|
58 | 58 | FSEventWrap::~FSEventWrap() { |
@@ -101,7 +101,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) { |
101 | 101 | if (args[2]->IsTrue()) |
102 | 102 | flags |= UV_FS_EVENT_RECURSIVE; |
103 | 103 |
|
104 | | - wrap->encoding_ = ParseEncoding(env->isolate(), args[3], UTF8); |
| 104 | + wrap->encoding_ = ParseEncoding(env->isolate(), args[3], kDefaultEncoding); |
105 | 105 |
|
106 | 106 | int err = uv_fs_event_init(wrap->env()->event_loop(), &wrap->handle_); |
107 | 107 | if (err == 0) { |
|