[Streams API] Calling controller.error() should trigger storing an undefined error
[WebKit-https.git] / Source / WebCore / bindings / js / JSReadableStreamControllerCustom.cpp
index f1b587e..12d49cb 100644 (file)
@@ -61,12 +61,12 @@ JSValue JSReadableStreamController::enqueue(ExecState* exec)
     return jsUndefined();
 }
 
-JSValue JSReadableStreamController::error(ExecState* exec)
+JSValue JSReadableStreamController::error(ExecState* state)
 {
     ReadableJSStream& stream = impl().stream();
     if (!stream.isReadable())
-        return exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Calling error on a stream which is not readable")));
-    stream.storeError(*exec);
+        return state->vm().throwException(state, createTypeError(state, ASCIILiteral("Calling error on a stream which is not readable")));
+    stream.storeError(*state, state->argument(0));
     return jsUndefined();
 }