mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.
This commit is contained in:
parent
65d4b12bf2
commit
5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions
|
@ -369,9 +369,13 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
|
|||
// Step 4
|
||||
Some(Method::Connect) | Some(Method::Trace) => Err(Security),
|
||||
Some(Method::Extension(ref t)) if t.as_slice() == "TRACK" => Err(Security),
|
||||
Some(_) if method.is_token() => {
|
||||
Some(parsed_method) => {
|
||||
// Step 3
|
||||
if !method.is_token() {
|
||||
return Err(Syntax)
|
||||
}
|
||||
|
||||
*self.request_method.borrow_mut() = maybe_method.unwrap();
|
||||
*self.request_method.borrow_mut() = parsed_method;
|
||||
|
||||
// Step 6
|
||||
let base = self.global.root().r().get_url();
|
||||
|
@ -675,7 +679,9 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
|
|||
self.status.get()
|
||||
}
|
||||
fn StatusText(self) -> ByteString {
|
||||
self.status_text.borrow().clone()
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let status_text = self.status_text.borrow();
|
||||
status_text.clone()
|
||||
}
|
||||
fn GetResponseHeader(self, name: ByteString) -> Option<ByteString> {
|
||||
self.filter_response_headers().iter().find(|h| {
|
||||
|
@ -981,9 +987,12 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
|
|||
None => {}
|
||||
}
|
||||
|
||||
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let response = self.response.borrow();
|
||||
// According to Simon, decode() should never return an error, so unwrap()ing
|
||||
// the result should be fine. XXXManishearth have a closer look at this later
|
||||
encoding.decode(self.response.borrow().as_slice(), DecoderTrap::Replace).unwrap().to_owned()
|
||||
encoding.decode(response.as_slice(), DecoderTrap::Replace).unwrap().to_owned()
|
||||
}
|
||||
fn filter_response_headers(self) -> Headers {
|
||||
// http://fetch.spec.whatwg.org/#concept-response-header-list
|
||||
|
@ -992,7 +1001,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
|
|||
use hyper::header::SetCookie;
|
||||
|
||||
// a dummy header so we can use headers.remove::<SetCookie2>()
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
struct SetCookie2;
|
||||
impl Header for SetCookie2 {
|
||||
fn header_name() -> &'static str {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue