[Streams API] Collecting a ReadableStreamReader should not unlock its stream
[WebKit-https.git] / Source / WebCore / bindings / js / JSReadableStreamCustom.cpp
index 59865155a83cb03eadc0f541beca7e75f2f5b420..581e4363fd180b37ae19829699b1f2de40269a72 100644 (file)
@@ -54,7 +54,7 @@ JSValue JSReadableStream::cancel(ExecState* exec)
 
 JSValue JSReadableStream::getReader(ExecState* exec)
 {
-    if (impl().reader())
+    if (impl().isLocked())
         return exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("ReadableStream is locked")));
     return toJS(exec, globalObject(), impl().createReader());
 }