Remove unrooted() methods

This commit is contained in:
Anthony Ramine 2015-04-27 18:13:32 +02:00
parent af21229c0e
commit 2770886196
3 changed files with 10 additions and 33 deletions

View file

@ -129,7 +129,7 @@ impl<'a> HTMLCanvasElementHelpers for JSRef<'a, HTMLCanvasElement> {
let context = self.GetContext(String::from_str("2d"));
match context.unwrap() {
CanvasRenderingContext2DOrWebGLRenderingContext::eCanvasRenderingContext2D(context) => {
Temporary::new(context.root().r().unrooted())
Temporary::from_unrooted(context)
}
_ => panic!("Wrong Context Type: Expected 2d context"),
}
@ -139,8 +139,8 @@ impl<'a> HTMLCanvasElementHelpers for JSRef<'a, HTMLCanvasElement> {
let context = self.GetContext(String::from_str("webgl"));
match context.unwrap() {
CanvasRenderingContext2DOrWebGLRenderingContext::eWebGLRenderingContext(context) => {
return Temporary::new(context.root().r().unrooted());
}
Temporary::from_unrooted(context)
},
_ => panic!("Wrong Context Type: Expected webgl context"),
}
}