File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3490,6 +3490,14 @@ void WritableStreamJsController::setup(jsg::Lock& js,
34903490 jsg::Optional<StreamQueuingStrategy> maybeQueuingStrategy) {
34913491 auto underlyingSink = kj::mv (maybeUnderlyingSink).orDefault ({});
34923492 auto queuingStrategy = kj::mv (maybeQueuingStrategy).orDefault ({});
3493+
3494+ if (FeatureFlags::get (js).getPedanticWpt ()) {
3495+ // Per the spec, the type property for WritableStream's underlying sink must be undefined.
3496+ // If it's anything else, throw a RangeError.
3497+ JSG_REQUIRE (underlyingSink.type == kj::none, RangeError,
3498+ " Invalid underlying sink type. Only undefined is valid." );
3499+ }
3500+
34933501 // We account for the memory usage of the WritableStreamDefaultController and AbortSignal together
34943502 // because their lifetimes are identical and memory accounting itself has a memory overhead.
34953503 state = js.allocAccounted <WritableStreamDefaultController>(
Original file line number Diff line number Diff line change @@ -747,12 +747,10 @@ export default {
747747 ? [
748748 'controller argument should be passed to start method' ,
749749 'WritableStream should be writable and ready should fulfill immediately if the strategy does not apply backpressure' ,
750- "WritableStream can't be constructed with a defined type" ,
751750 ]
752751 : [
753752 'controller argument should be passed to start method' ,
754753 'WritableStream should be writable and ready should fulfill immediately if the strategy does not apply backpressure' ,
755- "WritableStream can't be constructed with a defined type" ,
756754 'underlyingSink argument should be converted after queuingStrategy argument' ,
757755 ] ,
758756 } ,
You can’t perform that action at this time.
0 commit comments