sendanor / node-crypt3

crypt(3) for Node.js
MIT License
19 stars 18 forks source link

add node 0.11 compatibility #6

Closed rlidwka closed 10 years ago

rlidwka commented 10 years ago

Currently node 0.11 can't compile this, because they changed interfaces:

/home/alex/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> Method(const int&)’:
/home/alex/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../crypt3.cc:11:14: error: within this context
  HandleScope scope;
              ^
../crypt3.cc:13:11: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
  if (args.Length() < 2) {
           ^
../crypt3.cc:14:39: error: ‘New’ is not a member of ‘v8::String’
   ThrowException(Exception::TypeError(String::New("Wrong number of arguments")));

This patch should fix this, I tested on both 0.11.13 and 0.10.31.

I'm using nan module for this, because manually supporting both versions looks too complex.

Also, added smoke tests, so you could this check automated with travis or something like that.

rlidwka commented 10 years ago

can you please publish those changes to npm registry?

thejhh commented 10 years ago

Hmm, I thought it was there already. I must have forgot to pull changes to my local copy.

Released version 0.1.6 today.