Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated openzwave.cc for nodejs 0.12 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simon-jentzsch
Copy link

Here I applied only the changes needed in order to run the addon in nodejs 0.12

Here I applied only the changes needed in order to run the addon in nodejs 0.12
@jperkin
Copy link
Owner

jperkin commented Apr 2, 2015

Thanks for this! Unfortunately you seem to have included whitespace changes which makes it very difficult to see exactly what is required to support 0.12.

My plan is to move to using https://github.com/tjfontaine/node-addon-layer as I did recently with https://github.com/jperkin/node-rpio which will isolate the addon from further API changes but I'd be happy to pull in a fix for 0.12 in the meantime as long as it didn't break older releases.

@ghost
Copy link

ghost commented Apr 4, 2015

Hi,
unfortunately, the setValue method cant be called from javascript with this patch in node 0.12:

TypeError: Illegal invocation
at zwave.setValue (/home/node_modules/openzwave/test.js:128:1)
at Object. (/home/node_modules/openzwave/test.js:131:7)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
br

@ekarak
Copy link

ekarak commented Apr 5, 2015

Yes. I stumbled upon the same issue yesterday. Seems node js 0.12 is a
mess. Root cause is:

There is an inherit() function in lib/openzwave.js which copies the
functions exposed by openzwave.CC from one prototype to another. This is
b0rken in 0.12.
So the following works perfectly:
zwave.addon.setValue()

hmmt the inherit method tries to copy setValue to the wrapper object but
gets an incomplete copy perhaps?

Note: I recompiled for 0.10.36 and I went back to normal. Node JS IS SUCH A
MESS!
Στις 5 Απρ 2015 2:21 π.μ., ο χρήστης "Markus Schweitzer" <
notifications@github.com> έγραψε:

Hi,
unfortunately, the setValue method cant be called from javascript with
this patch in node 0.12:

TypeError: Illegal invocation
at zwave.setValue (/home/node_modules/openzwave/test.js:128:1)
at Object. (/home/node_modules/openzwave/test.js:131:7)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
br


Reply to this email directly or view it on GitHub
#48 (comment).

@ekarak
Copy link

ekarak commented Jun 7, 2015

Hi all,
I've just committed a 'nan' branch of my 'node-openzwave-shared' project where all the Node.JS API is wrapped in NaN (Node.JS is A Nightmare) - please check out a copy of the code and give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants