aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2013-10-21 13:31:48 -0700
committerKeegan McAllister <kmcallister@mozilla.com>2013-10-22 12:52:04 -0700
commit30a9fb2f45bf62f78370388134b19b0499dde6ef (patch)
tree0362782b34cf3be2a89e936ee44a731beeaf2684 /src/components/script/dom/blob.rs
parent797143a1d3e09b4ddd35a1ce5948be424ec3f9ef (diff)
downloadservo-30a9fb2f45bf62f78370388134b19b0499dde6ef.tar.gz
servo-30a9fb2f45bf62f78370388134b19b0499dde6ef.zip
Factor out a helper for eagerly creating JS wrappers
Diffstat (limited to 'src/components/script/dom/blob.rs')
-rw-r--r--src/components/script/dom/blob.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/components/script/dom/blob.rs b/src/components/script/dom/blob.rs
index 9e265e4114b..8d1ef93338a 100644
--- a/src/components/script/dom/blob.rs
+++ b/src/components/script/dom/blob.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use dom::bindings::utils::{Reflectable, Reflector};
+use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::utils::Fallible;
use dom::bindings::codegen::BlobBinding;
use dom::window::Window;
@@ -23,14 +23,7 @@ impl Blob {
}
pub fn new(window: @mut Window) -> @mut Blob {
- let blob = @mut Blob::new_inherited(window);
- let cx = window.get_cx();
- let scope = window.reflector().get_jsobject();
- if BlobBinding::Wrap(cx, scope, blob).is_null() {
- fail!("BlobBinding::Wrap failed");
- }
- assert!(blob.reflector().get_jsobject().is_not_null());
- blob
+ reflect_dom_object(@mut Blob::new_inherited(window), window, BlobBinding::Wrap)
}
}