提交 3f23a315 编写于 作者: M Mislav Marohnić

Simplify `Response.clone()`

上级 fd362ddb
......@@ -236,17 +236,6 @@
this._initBody(body)
}
function cloneBody(body) {
if (body._bodyText) {
return body._bodyText
} else if (body._bodyBlob) {
return body._bodyBlob
} else if (body._bodyFormData) {
return body._bodyFormData
}
return null
}
Request.prototype.clone = function() {
return new Request(this)
}
......@@ -295,7 +284,7 @@
Body.call(Response.prototype)
Response.prototype.clone = function() {
return new Response(cloneBody(this), {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册