Don't allow unrooted values in function arguments.

This commit is contained in:
Eli Friedman 2015-10-20 11:05:27 -07:00
parent 81ecf7824c
commit a9ef40c716
4 changed files with 17 additions and 10 deletions

View file

@ -18,6 +18,7 @@ pub struct FileList {
}
impl FileList {
#[allow(unrooted_must_root)]
fn new_inherited(files: Vec<JS<File>>) -> FileList {
FileList {
reflector_: Reflector::new(),
@ -25,6 +26,7 @@ impl FileList {
}
}
#[allow(unrooted_must_root)]
pub fn new(window: &Window, files: Vec<JS<File>>) -> Root<FileList> {
reflect_dom_object(box FileList::new_inherited(files), GlobalRef::Window(window), FileListBinding::Wrap)
}