зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1507952 - Part 5: stream.tee() should not try to call a .start() method. r=arai
This fix is not particularly clean, but at least it's possible to see why the if statement is there, now that the comments explain how we (imperfectly) implement the {start,pull,cancel}Algorithm arguments. Differential Revision: https://phabricator.services.mozilla.com/D12459 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2f1b367c05
Коммит
20768c8825
|
@ -3135,10 +3135,14 @@ SetUpReadableStreamDefaultController(JSContext* cx,
|
|||
stream->setController(controller);
|
||||
|
||||
// Step 9: Let startResult be the result of performing startAlgorithm.
|
||||
// If this is a tee stream, the startAlgorithm does nothing and returns
|
||||
// undefined.
|
||||
RootedValue startResult(cx);
|
||||
RootedValue controllerVal(cx, ObjectValue(*controller));
|
||||
if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, &startResult)) {
|
||||
return false;
|
||||
if (!underlyingSource.isObject() || !underlyingSource.toObject().is<TeeState>()) {
|
||||
RootedValue controllerVal(cx, ObjectValue(*controller));
|
||||
if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, &startResult)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Step 10: Let startPromise be a promise resolved with startResult.
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// |reftest| skip-if(!this.ReadableStream||!this.drainJobQueue)
|
||||
// stream.tee() shouldn't try to call a .start() method.
|
||||
|
||||
Object.prototype.start = function () { throw "FAIL"; };
|
||||
let source = Object.create(null);
|
||||
new ReadableStream(source).tee();
|
||||
|
||||
drainJobQueue();
|
||||
|
||||
if (typeof reportCompare == 'function')
|
||||
reportCompare(0, 0);
|
|
@ -1,4 +0,0 @@
|
|||
[patched-global.dedicatedworker.html]
|
||||
[ReadableStream tee() should not touch Object.prototype properties]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[patched-global.html]
|
||||
[ReadableStream tee() should not touch Object.prototype properties]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[patched-global.serviceworker.https.html]
|
||||
[ReadableStream tee() should not touch Object.prototype properties]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[patched-global.sharedworker.html]
|
||||
[ReadableStream tee() should not touch Object.prototype properties]
|
||||
expected: FAIL
|
||||
|
Загрузка…
Ссылка в новой задаче