你好V8程序员和node-gyp'ers。我跑OS X 10.12.6
,Node v6.11.1
与npm v3.10.10
,nan v2.6.2
,gcc
作为的XCode与此版本输出部分:如何在'node-gyp rebuild`中静默“'NewInstance'已被弃用”警告? v8中NewInstance的替代选择是什么?
$ > gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
请帮助我了解如何正确使用NewInstance方法和过程中的npm install
或node-gyp rebuild
过程消除警告我定制软件包安装?
> node-gyp rebuild
CXX(target) Release/obj.target/cellcrypt/src/cellcrypt.o
CC(target) Release/obj.target/cellcrypt/src/decode.o
CXX(target) Release/obj.target/cellcrypt/src/DecryptionWrapper.o
../src/DecryptionWrapper.cpp:55:44: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Object> instance = cons->NewInstance();
^
/Users/sjcbsolo/.node-gyp/6.11.1/include/node/v8.h:3276:52: note: 'NewInstance' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
^
1 warning generated.
CC(target) Release/obj.target/cellcrypt/src/Encryption.o
SOLINK_MODULE(target) Release/cellcrypt.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
我不想看到那些警告,如果我不必。我发现通过要求NewInstance方法被调用的方式上github开放售票细节修复到另一个插件包:
info.GetReturnValue().Set(cons->NewInstance(argc, argv));
info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked());
什么是实现Nan::NewInstance()
不违反速度和效率太多贝斯特的方式?