Commit 9837177b authored by Kenton Varda's avatar Kenton Varda

Some tweaks made while working on v8 bindings.

parent 7644d6b1
......@@ -585,7 +585,7 @@ public:
VoidPromiseAndPipeline call(uint64_t interfaceId, uint16_t methodId,
kj::Own<CallContextHook>&& context) override {
return VoidPromiseAndPipeline { kj::cp(exception), kj::heap<BrokenPipeline>(exception) };
return VoidPromiseAndPipeline { kj::cp(exception), kj::refcounted<BrokenPipeline>(exception) };
}
kj::Maybe<ClientHook&> getResolved() {
......
......@@ -488,6 +488,16 @@ kj::Maybe<Compiler::Node::Content&> Compiler::Node::getContent(Content::State mi
auto builder = schemaNode.get();
builder.setId(id);
builder.setDisplayName(displayName);
// TODO(cleanup): Would be better if we could remember the prefix length from before we
// added this decl's name to the end.
KJ_IF_MAYBE(lastDot, displayName.findLast('.')) {
builder.setDisplayNamePrefixLength(*lastDot + 1);
}
KJ_IF_MAYBE(lastColon, displayName.findLast(':')) {
if (*lastColon > builder.getDisplayNamePrefixLength()) {
builder.setDisplayNamePrefixLength(*lastColon + 1);
}
}
KJ_IF_MAYBE(p, parent) {
builder.setScopeId(p->id);
}
......
......@@ -117,6 +117,8 @@ public:
DynamicEnum() = default;
inline DynamicEnum(EnumSchema::Enumerant enumerant)
: schema(enumerant.getContainingEnum()), value(enumerant.getOrdinal()) {}
inline DynamicEnum(EnumSchema schema, uint16_t value)
: schema(schema), value(value) {}
template <typename T, typename = kj::EnableIf<kind<T>() == Kind::ENUM>>
inline DynamicEnum(T&& value): DynamicEnum(toDynamic(value)) {}
......@@ -139,9 +141,6 @@ private:
EnumSchema schema;
uint16_t value;
inline DynamicEnum(EnumSchema schema, uint16_t value)
: schema(schema), value(value) {}
uint16_t asImpl(uint64_t requestedTypeId) const;
friend struct DynamicStruct;
......
......@@ -125,6 +125,7 @@ private:
friend class ExceptionImpl;
};
// TODO(soon): These should return StringPtr.
ArrayPtr<const char> KJ_STRINGIFY(Exception::Nature nature);
ArrayPtr<const char> KJ_STRINGIFY(Exception::Durability durability);
String KJ_STRINGIFY(const Exception& e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment