aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/textdecoder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/textdecoder.rs')
-rw-r--r--components/script/dom/textdecoder.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/textdecoder.rs b/components/script/dom/textdecoder.rs
index 7d664242467..b81fd538c6b 100644
--- a/components/script/dom/textdecoder.rs
+++ b/components/script/dom/textdecoder.rs
@@ -8,12 +8,13 @@ use crate::dom::bindings::codegen::Bindings::TextDecoderBinding::{
};
use crate::dom::bindings::codegen::UnionTypes::ArrayBufferViewOrArrayBuffer;
use crate::dom::bindings::error::{Error, Fallible};
-use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
+use crate::dom::bindings::reflector::{reflect_dom_object2, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::{DOMString, USVString};
use crate::dom::globalscope::GlobalScope;
use dom_struct::dom_struct;
use encoding_rs::{Decoder, DecoderResult, Encoding};
+use js::rust::HandleObject;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
@@ -54,21 +55,24 @@ impl TextDecoder {
))
}
- pub fn new(
+ fn new(
global: &GlobalScope,
+ proto: Option<HandleObject>,
encoding: &'static Encoding,
fatal: bool,
ignoreBOM: bool,
) -> DomRoot<TextDecoder> {
- reflect_dom_object(
+ reflect_dom_object2(
Box::new(TextDecoder::new_inherited(encoding, fatal, ignoreBOM)),
global,
+ proto,
)
}
/// <https://encoding.spec.whatwg.org/#dom-textdecoder>
pub fn Constructor(
global: &GlobalScope,
+ proto: Option<HandleObject>,
label: DOMString,
options: &TextDecoderBinding::TextDecoderOptions,
) -> Fallible<DomRoot<TextDecoder>> {
@@ -78,6 +82,7 @@ impl TextDecoder {
};
Ok(TextDecoder::new(
global,
+ proto,
encoding,
options.fatal,
options.ignoreBOM,