GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: initialize encoding_ data member · nodejs/node@3b1c19f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • fs_event_wrap.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/fs_event_wrap.cc‎

Copy file name to clipboardExpand all lines: src/fs_event_wrap.cc
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ class FSEventWrap: public HandleWrap {
3434
size_t self_size() const override { return sizeof(*this); }
3535

3636
private:
37+
static const encoding kDefaultEncoding = UTF8;
38+
3739
FSEventWrap(Environment* env, Local<Object> object);
3840
~FSEventWrap() override;
3941

4042
static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
4143
int status);
4244

4345
uv_fs_event_t handle_;
44-
bool initialized_;
45-
enum encoding encoding_;
46+
bool initialized_ = false;
47+
enum encoding encoding_ = kDefaultEncoding;
4648
};
4749

4850

4951
FSEventWrap::FSEventWrap(Environment* env, Local<Object> object)
5052
: HandleWrap(env,
5153
object,
5254
reinterpret_cast<uv_handle_t*>(&handle_),
53-
AsyncWrap::PROVIDER_FSEVENTWRAP) {
54-
initialized_ = false;
55-
}
55+
AsyncWrap::PROVIDER_FSEVENTWRAP) {}
5656

5757

5858
FSEventWrap::~FSEventWrap() {
@@ -101,7 +101,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
101101
if (args[2]->IsTrue())
102102
flags |= UV_FS_EVENT_RECURSIVE;
103103

104-
wrap->encoding_ = ParseEncoding(env->isolate(), args[3], UTF8);
104+
wrap->encoding_ = ParseEncoding(env->isolate(), args[3], kDefaultEncoding);
105105

106106
int err = uv_fs_event_init(wrap->env()->event_loop(), &wrap->handle_);
107107
if (err == 0) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.