Introduce a NativeProperties struct to store the properties.

This will simplify adding more kinds of properties, such as static attributes.
This commit is contained in:
Ms2ger 2014-06-21 12:38:45 +02:00
parent da28a791e5
commit 886d401ff0
2 changed files with 43 additions and 16 deletions

View file

@ -215,6 +215,13 @@ pub fn GetProtoOrIfaceArray(global: *mut JSObject) -> *mut *mut JSObject {
}
}
pub struct NativeProperties {
pub methods: Option<&'static [JSFunctionSpec]>,
pub attrs: Option<&'static [JSPropertySpec]>,
pub consts: Option<&'static [ConstantSpec]>,
pub staticMethods: Option<&'static [JSFunctionSpec]>,
}
pub type NonNullJSNative =
unsafe extern "C" fn (arg1: *mut JSContext, arg2: c_uint, arg3: *mut JSVal) -> JSBool;