node-oracle icon indicating copy to clipboard operation
node-oracle copied to clipboard

Compile on node 11.14 using nan v1.3.0

Open ericwaldheim opened this issue 10 years ago • 2 comments

Hello, I failed to find any work done on a node 0.11.14 port so I modified the source to compile on node 0.11.14 by using nan v1.3.0. I built and ran regression tests on both node 0.11.14 and 0.10.25. (The database setup in test/outparams.js appears to be missing setup for procedure "procDateTimeOutParam".)

The modifications were straightforward except for:

  1. I replaced String::NewSymbol with NanNew<String>. Nan docs indicate this is correct but I'd like to confirm.
  2. reader.cpp line 124 baton->callback.Clear(); I could not find the Nan replacement for the Clear call. I just blithely commented it out. What is the correct answer?
  3. statement.cpp line 94 baton->callback.Clear(); Same issue as number 2).

And I suppose question one is, how do you feel about nan?

Thank you, Eric

ericwaldheim avatar Oct 20 '14 21:10 ericwaldheim

I looked into the Clear() issue further. Looks like the converted code with Clear removed is correct. Here's the translation in nan:

https://github.com/rvagg/nan/blob/d945fd11f83c6ba612c3eefcd579edaab5aa2e2e/nan.h#L1573-L1578

template<typename T>
  NAN_INLINE void NanDisposePersistent(
      v8::Persistent<T> &handle) {  // NOLINT(runtime/references)
    handle.Dispose();
    handle.Clear();
  }

ericwaldheim avatar Oct 21 '14 19:10 ericwaldheim

Here is the relevant comment from nan docs for "issue 1)" mentioned above. I believe this is converted correctly. https://github.com/rvagg/nan#localstring-nansymbolconst-char-

ericwaldheim avatar Oct 21 '14 20:10 ericwaldheim