Bug 1507845 - Dispense with TODO comment about cloneForBranch2 in ReadableStream implementation. r=arai
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 16 Nov 2018 17:12:42 +0000
changeset 503453 d7e11cee5ff83b1889f2da5911a8076dad40531a
parent 503452 55384416e4fe28e7adaac150e184665d041c524b
child 503454 56372a3d2856e55d259e52b063364d3b0600ba73
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1507845
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507845 - Dispense with TODO comment about cloneForBranch2 in ReadableStream implementation. r=arai Differential Revision: https://phabricator.services.mozilla.com/D12148
js/src/builtin/Stream.cpp
--- a/js/src/builtin/Stream.cpp
+++ b/js/src/builtin/Stream.cpp
@@ -973,18 +973,20 @@ TeeReaderReadHandler(JSContext* cx, unsi
     // Step g: Let value1 and value2 be value.
     RootedValue value1(cx, value);
     RootedValue value2(cx, value);
 
     // Step h: If teeState.[[canceled2]] is false and cloneForBranch2 is
     //         true, set value2 to
     //         ? StructuredDeserialize(StructuredSerialize(value2),
     //                                 the current Realm Record).
-    // TODO: add StructuredClone() intrinsic.
-    MOZ_ASSERT(!unwrappedTeeState->cloneForBranch2(), "tee(cloneForBranch2=true) should not be exposed");
+    // We don't yet support any specifications that use cloneForBranch2, and
+    // the Streams spec doesn't offer any way for author code to enable it,
+    // so it's always false here.
+    MOZ_ASSERT(!unwrappedTeeState->cloneForBranch2());
 
     // Step i: If teeState.[[canceled1]] is false, perform
     //         ? ReadableStreamDefaultControllerEnqueue(branch1, value1).
     Rooted<ReadableStreamDefaultController*> unwrappedController(cx);
     if (!unwrappedTeeState->canceled1()) {
         unwrappedController = unwrappedTeeState->branch1();
         if (!ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, value1)) {
             return false;