Skip to content

Commit

Permalink
ci: add WPT debug build, fix streams assertion failure (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Aug 16, 2024
1 parent 10e5106 commit 4e91e5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
name: Web Platform Tests
strategy:
matrix:
build: [release]
build: [release, debug]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
18 changes: 16 additions & 2 deletions builtins/web/streams/transform-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ void TransformStream::set_owner(JSObject *self, JSObject *owner) {

JSObject *TransformStream::readable(JSObject *self) {
MOZ_ASSERT(is_instance(self));
if (!JS::GetReservedSlot(self, TransformStream::Slots::Readable).isObject()) {
return nullptr;
}
return &JS::GetReservedSlot(self, TransformStream::Slots::Readable).toObject();
}

Expand Down Expand Up @@ -323,6 +326,9 @@ void TransformStream::set_readable_used_as_body(JSContext *cx, JS::HandleObject

JSObject *TransformStream::writable(JSObject *self) {
MOZ_ASSERT(is_instance(self));
if (!JS::GetReservedSlot(self, TransformStream::Slots::Writable).isObject()) {
return nullptr;
}
return &JS::GetReservedSlot(self, TransformStream::Slots::Writable).toObject();
}

Expand Down Expand Up @@ -372,13 +378,21 @@ void TransformStream::set_used_as_mixin(JSObject *self) {

bool TransformStream::readable_get(JSContext *cx, unsigned argc, JS::Value *vp) {
METHOD_HEADER_WITH_NAME(0, "get readable")
args.rval().setObject(*readable(self));
auto readable_val = readable(self);
// TODO: determine why this isn't being set in some cases
if (readable_val) {
args.rval().setObject(*readable_val);
}
return true;
}

bool TransformStream::writable_get(JSContext *cx, unsigned argc, JS::Value *vp) {
METHOD_HEADER_WITH_NAME(0, "get writable")
args.rval().setObject(*writable(self));
auto writable_val = writable(self);
// TODO: determine why this isn't being set in some cases
if (writable_val) {
args.rval().setObject(*writable_val);
}
return true;
}

Expand Down

0 comments on commit 4e91e5c

Please sign in to comment.