diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-06-20 23:20:12 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-06-22 15:15:18 +0200 |
commit | 4f0d6979e7c38abd1addb87c8f27ffeb52967feb (patch) | |
tree | dd75ef063f959432c52613d7e3fc9730b02f8acc /src/components/script/dom/bindings/utils.rs | |
parent | 6d2784aece4d5e8a3a605ddb1397d3d7c0efdf0c (diff) | |
download | servo-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.rs | 6 |
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), _ => (), |