[Streams API] Collecting a ReadableStreamReader should not unlock its stream
[WebKit-https.git] / Source / WebCore / bindings / js / JSReadableStreamReaderCustom.cpp
index 61e6aed4731290feee7e57157e4fe6eaf0e6a96a..f06cb022b4431875df0129a09df31b9e08f9916b 100644 (file)
@@ -106,7 +106,7 @@ EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState* exec)
     if (!stream)
         return throwVMError(exec, createTypeError(exec, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream")));
 
-    if (stream->impl().reader())
+    if (stream->impl().isLocked())
         return throwVMError(exec, createTypeError(exec, ASCIILiteral("ReadableStreamReader constructor parameter is a locked ReadableStream")));
 
     return JSValue::encode(toJS(exec, stream->globalObject(), stream->impl().createReader()));