Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upA new Request(input, init) constructor step sounds weird. #1061
Comments
|
Well, inputBody is only set to a non-null value if that is the case, no? |
|
Do you mean the case is "If inputBody is body" ? No, it can be both inputBody is null and body is null. |
|
Neither body nor inputBody can be a Request object. They are null or a body. So
always returns false. |
|
But disturbed/locked also does a non-null check so that part is covered, no? (We could make step 38 step 39.0 I suppose and assert that input's body is non-null, but would that make it better?) |
|
@yutakahirano @annevk |
|
@yoichio I don't follow. A |
Yes. I feel discussion is going wrong. Back to the original question: |
|
I see, so yeah, moving step 38 to 39.0 would be the right approach here as we need to know that body/inputBody are non-null. |


https://fetch.spec.whatwg.org/#dom-request
A step 38th states:
"38. If inputBody is body and input is disturbed or locked, then throw a TypeError."
However If input is string, asking if it is disturbed or locked doesn't make sense because disturbed and locked are defined only on a Body mixin.
It should be
"38. If inputBody is body and a Request object, and input is disturbed or locked, then throw a TypeError." ?