diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-23 13:39:53 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-23 13:39:53 -0600 |
commit | 5ce7d8accfc52dd37b19b4400a643a980412bb2f (patch) | |
tree | e882f7262dbfe614db4b1cb0dbd9b3a9e17247f2 /components/script/dom/bindings/js.rs | |
parent | b1a35f549baad871a3691ae485af2efecd2d73f7 (diff) | |
parent | 48b151948f9eaa1ad732363bf46bb0c4b9719832 (diff) | |
download | servo-5ce7d8accfc52dd37b19b4400a643a980412bb2f.tar.gz servo-5ce7d8accfc52dd37b19b4400a643a980412bb2f.zip |
auto merge of #5327 : Ms2ger/servo/memory-explosion, r=Ms2ger
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 72f4c16e832..f390a6444ee 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -91,6 +91,12 @@ impl<T: Reflectable> Unrooted<T> { } } + /// Create a new unrooted value from a `Temporary<T>`. + #[allow(unrooted_must_root)] + pub fn from_temporary(ptr: Temporary<T>) -> Unrooted<T> { + Unrooted::from_js(ptr.inner) + } + /// Get the `Reflector` for this pointer. pub fn reflector<'a>(&'a self) -> &'a Reflector { unsafe { |