electron
electron copied to clipboard
Incorrect handling of boolean values from a native (node-gyp built) module
I've created a sample node-gyp project that returns boolean true/false values. It works as expected running under node, but when run under electron-prebuilt the values are incorrectly interpreted.
A sample project can be found here: https://bitbucket.org/kwaaioak/electron-test
Here's the substance of what I'm doing...
In C++: attributes->Set(Nan::New("should_be_true").ToLocalChecked(), Nan::Newv8::Boolean(true)); attributes->Set(Nan::New("should_be_false").ToLocalChecked(), Nan::Newv8::Boolean(false));
When run under node: should_be_true = (boolean)true should_be_false = (boolean)false
When run under electron: should_be_true = (boolean)false should_be_false = (string)
This doesn't seem like it should be an Electron issue, but starting here anyway.
$ node -v v6.2.0
$ node-gyp -v v3.3.1
$ ./node_modules/.bin/electron -v v1.2.5
The results are the same whether I'm using electron or electron-prebuilt