TooTallNate/node-weak

Can't install on Node 12

kirillgroshkov opened this issue · 10 comments

Gives this stacktrace:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/weakref/src/weakref.o
../src/weakref.cc:147:25: error: too few arguments to function call, expected 4, have 3; did you mean 'Nan::Call'?
  globalCallbackDirect->Call(Nan::GetCurrentContext()->Global(), 1, argv);
                        ^~~~
                        Nan::Call
../../nan/nan_maybe_43_inl.h:358:30: note: 'Nan::Call' declared here
inline MaybeLocal<v8::Value> Call(
                             ^
../src/weakref.cc:168:75: error: too few arguments to function call, single argument 'context' was not specified
  Local<Object> proxy = Nan::New<ObjectTemplate>(proxyClass)->NewInstance();
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/kirill/.node-gyp/12.1.0/include/node/v8.h:6244:3: note: 'NewInstance' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
  ^
/Users/kirill/.node-gyp/12.1.0/include/node/v8config.h:347:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/weakref.cc:223:55: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
  Local<Boolean> rtn = Nan::New<Boolean>(cont->target.IsNearDeath());
                                         ~~~~~~~~~~~~ ^
3 errors generated.
make: *** [Release/obj.target/weakref/src/weakref.o] Error 1
gyp ERR! build error 

This also breaks the usage of Jest with --detectLeaks flag. Issue there: jestjs/jest#8397

+1

+1

Is there any update?

Bump! Please fix.

@TooTallNate have you had a chance to look at this?

same for node16

any update?

I build the master branch from github for node 16 and it compiles fine! It just has never been tagged for release. I suppose the same is true fro the ref project @TooTallNate can you release it?

I decided to publish it on npm as node-weakref.

If you want to download it, it's called node-weak-ref on npm. And the working version is 1.3.0. Any contribution is appreciated.