Skip to content

Commit

Permalink
Make DOM getters that return &JS<T> return Temporary<T> instead #3707
Browse files Browse the repository at this point in the history
  • Loading branch information
ebalint committed Oct 22, 2014
1 parent 590a931 commit daf9e59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/browsercontext.rs
Expand Up @@ -39,7 +39,7 @@ impl BrowserContext {

pub fn active_window(&self) -> Temporary<Window> {
let doc = self.active_document().root();
Temporary::new(doc.window().clone())
doc.window()
}

pub fn window_proxy(&self) -> *mut JSObject {
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/document.rs
Expand Up @@ -344,8 +344,8 @@ impl Document {
}

#[inline]
pub fn window<'a>(&'a self) -> &'a JS<Window> {
&self.window
pub fn window(&self) -> Temporary<Window> {
Temporary::new(self.window)
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/node.rs
Expand Up @@ -2163,7 +2163,7 @@ pub fn document_from_node<T: NodeBase+Reflectable>(derived: JSRef<T>) -> Tempora

pub fn window_from_node<T: NodeBase+Reflectable>(derived: JSRef<T>) -> Temporary<Window> {
let document = document_from_node(derived).root();
Temporary::new(document.window().clone())
document.window()
}

impl<'a> VirtualMethods for JSRef<'a, Node> {
Expand Down

5 comments on commit daf9e59

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at ebalint@daf9e59

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ebalint/servo/3707_DOM_getters = daf9e59 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ebalint/servo/3707_DOM_getters = daf9e59 merged ok, testing candidate = 1bc9c04

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 1bc9c04

Please sign in to comment.