Implement response API Clone step 1

This commit is contained in:
Atte Lautanala 2016-10-22 18:37:36 +03:00
parent 62689ba64d
commit 65a7747864
2 changed files with 3 additions and 4 deletions

View file

@ -298,7 +298,9 @@ impl ResponseMethods for Response {
// https://fetch.spec.whatwg.org/#dom-response-clone
fn Clone(&self) -> Fallible<Root<Response>> {
// Step 1
// TODO: This step relies on body and stream, which are still unimplemented.
if self.is_locked() || self.body_used.get() {
return Err(Error::Type("cannot clone a disturbed response".to_string()));
}
// Step 2
let new_response = Response::new(&self.global());