Skip to content

Commit

Permalink
Make ReadableStream extendable
Browse files Browse the repository at this point in the history
IDL defined ReadableStream was not extendable because it didn't use
provided |info.Holder()| as its wrapper. Instead, it creates a new
wrapper in Create functions.

This CL solves the issue by making the constructor "custom". The custom
constructor creates a blink::ReadableStream first, then associates it
to the wrapper, and then calls the appropriate Init function.

Bug: 906476
Change-Id: I91a7fec1cf4ee5e08704a944b0af852584d1679e
Reviewed-on: https://chromium-review.googlesource.com/c/1347643
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610391}
  • Loading branch information
yutakahirano authored and chromium-wpt-export-bot committed Nov 22, 2018
1 parent 76781be commit a51c2df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions streams/readable-streams/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,13 @@ test(() => {
});
}, 'ReadableStream: desiredSize when errored');

test(() => {
class Extended extends ReadableStream {
newMethod() { return 'foo' };
};
assert_equals((new Extended()).newMethod(), 'foo');
}, 'ReadableStream: ReadableStream is extendable');

test(() => {

let startCalled = false;
Expand Down

0 comments on commit a51c2df

Please sign in to comment.