Compatibility with V8 in 0.11.3+ is a dogs-breakfast, lots of major changes.
See https://github.com/rvagg/nan also browse through the dependants of NAN to find examples of the kinds of things you'll need to change for 0.11 support while not breaking 0.10 and prior support: https://npmjs.org/browse/depended/nan If you have a specific question, feel free to file an issue on the NAN GitHub repo and ask. The specific problem you're running in to I believe is that your `constructor` is probably a Persistent type which are no longer a subclass of Handle so are much less useful as an operational type. You need to convert back to a Local each time you want to do anything useful with what the Persistent is referencing. There is a `NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>)` that deals with this particular case that you should be able to drop in as a replacement. Cheers, -- Rod On Sunday, 26 January 2014 12:02:30 UTC+11, [email protected] wrote: > > Trying to upgrade to v0.11.10 and higher. The HasInstance from v8 looks > like it is one of the few unchanged pieces in v8 yet no longer compiles as > available. Take code > > class Base : public node::ObjectWrap { > public: > ... > Handle<Value> Base::applyTransform(const v8::FunctionCallbackInfo<Value>& > args) > { > HandleScope scope(args.GetIsolate()); > Base* pThis = ObjectWrap::Unwrap<Base>(args.This()); > > if (args.Length()!=1 && > !Transformation::constructor->HasInstance(args[0])) { > ThrowException(Exception::Error(String::New("invalid > transformation"))); > return scope.Close(Undefined()); > } > .... > where the Transformation::constructor is static > Persistent<FunctionTemplate> constructor; > HasInstance is in v8.h#FunctionTemplate and implemented in api.cc. > > Not understanding why but get compiler error: > ../src/Base.cc: In static member function ‘static > v8::Handlev8::ValueBase::transformed(const v8::FunctionCallbackInfo > v8::Value&)’: > ../src/Base.cc:159:57: error: base operand of ‘->’ has non-pointer type > ‘v8::Persistent >’ > if (args.Length()!=1 && > !Transformation::constructor->HasInstance(args[0])) { > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
