diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-11-16 16:28:30 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-11-18 10:12:06 +0100 |
commit | a3da819d10cd7161f13a846dffa1d818b8d98c79 (patch) | |
tree | a63eae560d9b9a2e4e9b5d098b39f93761c2dbd3 /components/script/dom/bindings/js.rs | |
parent | 22aebdf5d41a3509cd6515ccf5edcdf33715a76d (diff) | |
download | servo-a3da819d10cd7161f13a846dffa1d818b8d98c79.tar.gz servo-a3da819d10cd7161f13a846dffa1d818b8d98c79.zip |
Make ServoParser::pending_input hold onto a BufferQueue
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 11aed4be9af..528b1213ccb 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -408,6 +408,12 @@ impl<T: Reflectable> MutNullableHeap<JS<T>> { } } + /// Gets the current value out of this object and sets it to `None`. + pub fn take(&self) -> Option<Root<T>> { + let value = self.get(); + self.set(None); + value + } } impl<T: Reflectable> PartialEq for MutNullableHeap<JS<T>> { |