Correctly handle pipelining on a Capability.

This commit is contained in:
Kenton Varda committed 2018-02-04 14:12:01 -08:00
1 parent 742d6b5b79
commit 7fb9018515
1 file changed
+10 -2
+10 -2
View File
@@ -2241,11 +2241,18 @@ void pipelineToJs(CapnpContext& context, capnp::DynamicStruct::Pipeline&& pipeli
v8::Handle<v8::Object> fieldValue;
switch (proto.which()) {
case capnp::schema::Field::SLOT:
switch (proto.getSlot().getType().which()) {
case capnp::schema::Field::SLOT: {
auto type = field.getType();
switch (type.which()) {
case capnp::schema::Type::STRUCT:
fieldValue = pipelineStructFieldToJs(context, pipeline, field, capConstructor);
break;
case capnp::schema::Type::ANY_POINTER:
if (type.whichAnyPointerKind() !=
capnp::schema::Type::AnyPointer::Unconstrained::CAPABILITY) {
continue;
}
// fallthrough
case capnp::schema::Type::INTERFACE: {
auto cap = pipeline.get(field).releaseAs<capnp::DynamicCapability>();
capnp::Schema capSchema = cap.getSchema();
@@ -2262,6 +2269,7 @@ void pipelineToJs(CapnpContext& context, capnp::DynamicStruct::Pipeline&& pipeli
continue;
}
break;
}
case capnp::schema::Field::GROUP:
fieldValue = pipelineStructFieldToJs(context, pipeline, field, capConstructor);