Silence lint for self.global in XHR

This commit is contained in:
Manish Goregaokar 2014-11-06 02:30:12 +05:30
parent 4a8af307d1
commit 52983ed97c
2 changed files with 4 additions and 4 deletions

View file

@ -160,7 +160,7 @@ impl LintPass for UnrootedPass {
ast::ExprAssign(_, ref e) | ast::ExprAssign(_, ref e) |
// Match statements allow you to bind onto the variable later in an arm // Match statements allow you to bind onto the variable later in an arm
// We need not check arms individually since enum/struct fields are already // We need not check arms individually since enum/struct fields are already
// linted in `check_struct_def` and `check_variant ` // linted in `check_struct_def` and `check_variant`
// (so there is no way of destructuring out a `#[must_root]` field) // (so there is no way of destructuring out a `#[must_root]` field)
ast::ExprMatch(ref e, _) | ast::ExprMatch(ref e, _) |
// For loops allow you to bind a return value locally // For loops allow you to bind a return value locally

View file

@ -13,7 +13,7 @@ use dom::bindings::codegen::InheritTypes::{EventCast, EventTargetCast, XMLHttpRe
use dom::bindings::conversions::ToJSValConvertible; use dom::bindings::conversions::ToJSValConvertible;
use dom::bindings::error::{Error, ErrorResult, Fallible, InvalidState, InvalidAccess}; use dom::bindings::error::{Error, ErrorResult, Fallible, InvalidState, InvalidAccess};
use dom::bindings::error::{Network, Syntax, Security, Abort, Timeout}; use dom::bindings::error::{Network, Syntax, Security, Abort, Timeout};
use dom::bindings::global::{GlobalField, GlobalRef, WorkerField}; use dom::bindings::global::{GlobalField, GlobalRef, WorkerRoot};
use dom::bindings::js::{MutNullableJS, JS, JSRef, Temporary, OptionalRootedRootable}; use dom::bindings::js::{MutNullableJS, JS, JSRef, Temporary, OptionalRootedRootable};
use dom::bindings::str::ByteString; use dom::bindings::str::ByteString;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
@ -698,8 +698,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
self.response_type.get() self.response_type.get()
} }
fn SetResponseType(self, response_type: XMLHttpRequestResponseType) -> ErrorResult { fn SetResponseType(self, response_type: XMLHttpRequestResponseType) -> ErrorResult {
match self.global { match self.global.root() {
WorkerField(_) if response_type == XMLHttpRequestResponseTypeValues::Document WorkerRoot(_) if response_type == XMLHttpRequestResponseTypeValues::Document
=> return Ok(()), => return Ok(()),
_ => {} _ => {}
} }