[Streams API] Synced bad strategy test with reference implementation
[WebKit-https.git] / Source / WebCore / bindings / js / ReadableJSStream.cpp
index ff18a2f..a7d21b2 100644 (file)
@@ -379,7 +379,7 @@ double ReadableJSStream::retrieveChunkSize(ExecState& state, JSValue chunk)
     if (state.hadException())
         return 0;
 
-    if (!std::isfinite(size)) {
+    if (!std::isfinite(size) || size < 0) {
         throwVMError(&state, createRangeError(&state, ASCIILiteral("Incorrect double value")));
         return 0;
     }