Open Bug 1504471 Opened 7 years ago Updated 3 years ago

Support tee streams with cloneForBranch2 (structured cloning)

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: jorendorff, Unassigned)

References

(Blocks 1 open bug)

Details

The standard contains this cryptic note: > Note: In this standard ReadableStreamTee is always called with > `cloneForBranch2` set to **false**; other specifications pass **true**. I don't know what "other specifications" uses this feature, so I'm not sure if it should be a priority or not. Seems easy to implement--mostly testing.
I filed this because our code contains this cryptic note: // TODO: add StructuredClone() intrinsic. MOZ_ASSERT(!teeState->cloneForBranch2(), "tee(cloneForBranch2=true) should not be exposed"); https://searchfox.org/mozilla-central/rev/50ba1dd30cf013bddce1ae756f1b3c95b26f0628/js/src/builtin/Stream.cpp#1216-1217 The deal is, it is in fact impossible (currently) for the `cloneForBranch2` argument to `ReadableStreamTee` to be `true`, so this assertion is fine, and the not-very-helpful comment can be changed to link to this bug.
Flags: needinfo?(jorendorff)
Flags: needinfo?(jorendorff)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.