diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-09-27 13:16:41 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 20:59:09 +0200 |
commit | fcb59d305742a18daa083352a9b6e9a45896c9f6 (patch) | |
tree | d1023c24bfb5827c49d4d4653a72541b66532b95 /components/script/dom/textdecoder.rs | |
parent | 093b189b4800909b17295b88aed762601f4b8482 (diff) | |
download | servo-fcb59d305742a18daa083352a9b6e9a45896c9f6.tar.gz servo-fcb59d305742a18daa083352a9b6e9a45896c9f6.zip |
Make reflect_dom_object take a &GlobalScope
Diffstat (limited to 'components/script/dom/textdecoder.rs')
-rw-r--r-- | components/script/dom/textdecoder.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/textdecoder.rs b/components/script/dom/textdecoder.rs index fae78342a73..4d0e18e87f6 100644 --- a/components/script/dom/textdecoder.rs +++ b/components/script/dom/textdecoder.rs @@ -10,6 +10,7 @@ use dom::bindings::global::GlobalRef; use dom::bindings::js::Root; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::{DOMString, USVString}; +use dom::globalscope::GlobalScope; use encoding::label::encoding_from_whatwg_label; use encoding::types::{DecoderTrap, EncodingRef}; use js::jsapi::{JSContext, JSObject}; @@ -36,7 +37,7 @@ impl TextDecoder { Err(Error::Range("The given encoding is not supported.".to_owned())) } - pub fn new(global: GlobalRef, encoding: EncodingRef, fatal: bool) -> Root<TextDecoder> { + pub fn new(global: &GlobalScope, encoding: EncodingRef, fatal: bool) -> Root<TextDecoder> { reflect_dom_object(box TextDecoder::new_inherited(encoding, fatal), global, TextDecoderBinding::Wrap) @@ -60,7 +61,7 @@ impl TextDecoder { Some("replacement") => return TextDecoder::make_range_error(), _ => () }; - Ok(TextDecoder::new(global, encoding, options.fatal)) + Ok(TextDecoder::new(global.as_global_scope(), encoding, options.fatal)) } } |