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

Incorrect handling of boolean values from a native (node-gyp built) module #13

Open
dazwin opened this issue Jun 28, 2016 · 0 comments
Open

Comments

@dazwin
Copy link

dazwin commented Jun 28, 2016

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

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

No branches or pull requests

1 participant