aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/utils.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-06-20 23:20:12 +0200
committerMs2ger <ms2ger@gmail.com>2014-06-22 15:15:18 +0200
commit4f0d6979e7c38abd1addb87c8f27ffeb52967feb (patch)
treedd75ef063f959432c52613d7e3fc9730b02f8acc /src/components/script/dom/bindings/utils.rs
parent6d2784aece4d5e8a3a605ddb1397d3d7c0efdf0c (diff)
downloadservo-4f0d6979e7c38abd1addb87c8f27ffeb52967feb.tar.gz
servo-4f0d6979e7c38abd1addb87c8f27ffeb52967feb.zip
Implement static attributes (fixes #1989).
Diffstat (limited to 'src/components/script/dom/bindings/utils.rs')
-rw-r--r--src/components/script/dom/bindings/utils.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs
index d9be42433d9..370b34f048a 100644
--- a/src/components/script/dom/bindings/utils.rs
+++ b/src/components/script/dom/bindings/utils.rs
@@ -220,6 +220,7 @@ pub struct NativeProperties {
pub attrs: Option<&'static [JSPropertySpec]>,
pub consts: Option<&'static [ConstantSpec]>,
pub staticMethods: Option<&'static [JSFunctionSpec]>,
+ pub staticAttrs: Option<&'static [JSPropertySpec]>,
}
pub type NonNullJSNative =
@@ -271,6 +272,11 @@ fn CreateInterfaceObject(cx: *mut JSContext, global: *mut JSObject, receiver: *m
_ => (),
}
+ match members.staticAttrs {
+ Some(staticProperties) => DefineProperties(cx, constructor, staticProperties),
+ _ => (),
+ }
+
match members.consts {
Some(constants) => DefineConstants(cx, constructor, constants),
_ => (),