V8 - All fields are undefined [closed]
I use V8 and I create an object like this :
_template->SetInternalFieldCount(1);
v8::NamedPropertyHandlerConfiguration *handler = new v8::NamedPropertyHandlerConfiguration;
handler->getter = &BSONObject::getter;
handler->setter = &BSONObject::setter;
_template->SetHandler(*handler);
Local<Object> obj = _template->NewInstance();
When I use my getter I put the variable in the JS object like this :
info.GetReturnValue().Set(prop->ToString());
All my fields are undefined
but I print prop->ToString()
on the line just above and it print the good value.
I don't know why is it undefined
...
c++ undefined v8
closed as off-topic by VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid Nov 19 '18 at 19:06
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
I use V8 and I create an object like this :
_template->SetInternalFieldCount(1);
v8::NamedPropertyHandlerConfiguration *handler = new v8::NamedPropertyHandlerConfiguration;
handler->getter = &BSONObject::getter;
handler->setter = &BSONObject::setter;
_template->SetHandler(*handler);
Local<Object> obj = _template->NewInstance();
When I use my getter I put the variable in the JS object like this :
info.GetReturnValue().Set(prop->ToString());
All my fields are undefined
but I print prop->ToString()
on the line just above and it print the good value.
I don't know why is it undefined
...
c++ undefined v8
closed as off-topic by VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid Nov 19 '18 at 19:06
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
I use V8 and I create an object like this :
_template->SetInternalFieldCount(1);
v8::NamedPropertyHandlerConfiguration *handler = new v8::NamedPropertyHandlerConfiguration;
handler->getter = &BSONObject::getter;
handler->setter = &BSONObject::setter;
_template->SetHandler(*handler);
Local<Object> obj = _template->NewInstance();
When I use my getter I put the variable in the JS object like this :
info.GetReturnValue().Set(prop->ToString());
All my fields are undefined
but I print prop->ToString()
on the line just above and it print the good value.
I don't know why is it undefined
...
c++ undefined v8
I use V8 and I create an object like this :
_template->SetInternalFieldCount(1);
v8::NamedPropertyHandlerConfiguration *handler = new v8::NamedPropertyHandlerConfiguration;
handler->getter = &BSONObject::getter;
handler->setter = &BSONObject::setter;
_template->SetHandler(*handler);
Local<Object> obj = _template->NewInstance();
When I use my getter I put the variable in the JS object like this :
info.GetReturnValue().Set(prop->ToString());
All my fields are undefined
but I print prop->ToString()
on the line just above and it print the good value.
I don't know why is it undefined
...
c++ undefined v8
c++ undefined v8
asked Nov 19 '18 at 14:11


Aurélien Foucault
788
788
closed as off-topic by VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid Nov 19 '18 at 19:06
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid
If this question can be reworded to fit the rules in the help center, please edit the question.
closed as off-topic by VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid Nov 19 '18 at 19:06
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – VTT, Toby Speight, Oussema Aroua, Matthieu Brucher, Killzone Kid
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are several examples of using SetHandler
in various ways in https://chromium.googlesource.com/v8/v8/+/master/test/cctest/test-api-interceptors.cc.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are several examples of using SetHandler
in various ways in https://chromium.googlesource.com/v8/v8/+/master/test/cctest/test-api-interceptors.cc.
add a comment |
There are several examples of using SetHandler
in various ways in https://chromium.googlesource.com/v8/v8/+/master/test/cctest/test-api-interceptors.cc.
add a comment |
There are several examples of using SetHandler
in various ways in https://chromium.googlesource.com/v8/v8/+/master/test/cctest/test-api-interceptors.cc.
There are several examples of using SetHandler
in various ways in https://chromium.googlesource.com/v8/v8/+/master/test/cctest/test-api-interceptors.cc.
answered Nov 19 '18 at 19:03
jmrk
5,715727
5,715727
add a comment |
add a comment |