Skip to content

Resolve deprecation warnings #3

@mikeokner

Description

@mikeokner

Latest builds on Travis are throwing deprecation warnings:

$ npm install
> [email protected] install /home/travis/build/mikeokner/posix-mq
> node-gyp rebuild
make: Entering directory `/home/travis/build/mikeokner/posix-mq/build'
  CXX(target) Release/obj.target/posixmq/src/posixmq.o
In file included from ../src/posixmq.cc:19:0:
../node_modules/nan/nan.h: In constructor ‘Nan::Utf8String::Utf8String(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1064:78: warning: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2537): Use maybe version [-Wdeprecated-declarations]
       v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
                                                                              ^
../src/posixmq.cc: In static member function ‘static void PosixMQ::poll_cb(uv_poll_t*, int, int)’:
../src/posixmq.cc:113:75: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../node_modules/nan/nan.h:958) [-Wdeprecated-declarations]
             Nan::MakeCallback(obj->handle(), emit, 1, read_emit_argv_local);
                                                                           ^
../src/posixmq.cc:130:76: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at ../node_modules/nan/nan.h:958) [-Wdeprecated-declarations]
             Nan::MakeCallback(obj->handle(), emit, 1, write_emit_argv_local);
                                                                            ^
../src/posixmq.cc: In static member function ‘static void PosixMQ::Open(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../src/posixmq.cc:185:58: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
         v8::Local<v8::Object> config = info[0]->ToObject();
                                                          ^
../src/posixmq.cc:195:42: warning: ‘bool v8::Value::BooleanValue() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2568): Use maybe version [-Wdeprecated-declarations]
             doCreate = val->BooleanValue();
                                          ^
../src/posixmq.cc:202:42: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
                 flags = val->Uint32Value();
                                          ^
../src/posixmq.cc:225:49: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
                 mode = (mode_t)val->Uint32Value();
                                                 ^
../src/posixmq.cc:239:55: warning: ‘bool v8::Value::BooleanValue() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2568): Use maybe version [-Wdeprecated-declarations]
             if (val->IsBoolean() && val->BooleanValue() == true) {
                                                       ^
../src/posixmq.cc:246:59: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
                 obj->mqattrs.mq_maxmsg = val->Uint32Value();
                                                           ^
../src/posixmq.cc:254:60: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
                 obj->mqattrs.mq_msgsize = val->Uint32Value();
                                                            ^
../src/posixmq.cc: In static member function ‘static void PosixMQ::Send(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../src/posixmq.cc:366:61: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
             if (info[1]->IsUint32() && info[1]->Uint32Value() < 32) {
                                                             ^
../src/posixmq.cc:367:49: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
                 priority = info[1]->Uint32Value();
                                                 ^
../src/posixmq.cc:377:85: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
             send_result = mq_send(obj->mqueue, node::Buffer::Data(info[0]->ToObject()),
                                                                                     ^
../src/posixmq.cc:378:56: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
                 node::Buffer::Length(info[0]->ToObject()), priority);
                                                        ^
../src/posixmq.cc: In static member function ‘static void PosixMQ::Receive(const Nan::FunctionCallbackInfo<v8::Value>&)’:
../src/posixmq.cc:424:46: warning: ‘bool v8::Value::BooleanValue() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:2568): Use maybe version [-Wdeprecated-declarations]
             retTuple = info[1]->BooleanValue();
                                              ^
../src/posixmq.cc:427:55: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/travis/.node-gyp/11.6.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
         v8::Local<v8::Object> buf = info[0]->ToObject();
                                                       ^
  SOLINK_MODULE(target) Release/obj.target/posixmq.node
  COPY Release/posixmq.node
make: Leaving directory `/home/travis/build/mikeokner/posix-mq/build'
added 1 package from 8 contributors and audited 1 package in 2.912s
found 0 vulnerabilities
The command "npm install" exited with 0.
0.08s$ node test.js
Writing 100 ('d') to the queue...
Writing 98 ('b') to the queue...
Writing 56 ('8') to the queue...
Writing 40 ('(') to the queue...
Writing 62 ('>') to the queue...
Writing 108 ('l') to the queue...
Writing 41 (')') to the queue...
Writing 83 ('S') to the queue...
Writing 41 (')') to the queue...
Writing 125 ('}') to the queue...
Writing 70 ('F') to the queue...
(node:5840) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Received message (1 bytes): d
Messages left: 9
Received message (1 bytes): b
Messages left: 8
Received message (1 bytes): 8
Messages left: 7
Received message (1 bytes): (
Messages left: 6
Received message (1 bytes): >
Messages left: 5
Received message (1 bytes): l
Messages left: 4
Received message (1 bytes): )
Messages left: 3
Received message (1 bytes): S
Messages left: 2
Received message (1 bytes): )
Messages left: 1
Received message (1 bytes): }
Messages left: 0
The command "node test.js" exited with 0.

Hopefully possible to resolve while still maintaining full backwards compatibility. If not we can drop support for versions of Node that are no longer supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions