in jones-ndb/impl/src/ndb/IndexBoundHelper.cpp [60:123]
void newIndexBound(const Arguments &args) {
EscapableHandleScope scope(args.GetIsolate());
NdbIndexScanOperation::IndexBound * bound =
new NdbIndexScanOperation::IndexBound;
Local<Value> jsBound = IndexBoundEnvelope.wrap(bound);
const Local<Object> spec = args[0]->ToObject();
Local<Value> v;
Local<Object> o;
bound->low_key = 0;
v = spec->Get(BOUND_LOW_KEY);
if(v->IsNull()) {
bound->low_key = 0;
} else {
o = v->ToObject();
bound->low_key = node::Buffer::Data(o);
}
bound->low_key_count = 0;
v = spec->Get(BOUND_LOW_KEY_COUNT);
if(! v->IsNull()) {
bound->low_key_count = v->Uint32Value();
}
bound->low_inclusive = false;
v = spec->Get(BOUND_LOW_INCLUSIVE);
if(! v->IsNull()) {
bound->low_inclusive = v->BooleanValue();
}
bound->high_key = 0;
v = spec->Get(BOUND_HIGH_KEY);
if(v->IsNull()) {
bound->high_key = 0;
} else {
o = v->ToObject();
bound->high_key = node::Buffer::Data(o);
}
bound->high_key_count = 0;
v = spec->Get(BOUND_HIGH_KEY_COUNT);
if(! v->IsNull()) {
bound->high_key_count = v->Uint32Value();
}
bound->high_inclusive = false;
v = spec->Get(BOUND_HIGH_INCLUSIVE);
if(! v->IsNull()) {
bound->high_inclusive = v->BooleanValue();
}
bound->range_no = 0;
v = spec->Get(BOUND_RANGE_NO);
if(! v->IsNull()) {
bound->range_no = v->Uint32Value();
}
debug_print_bound(bound);
args.GetReturnValue().Set(scope.Escape(jsBound));
}