mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Use snake case for the members of NativeProperties.
Note that the codegen uses the names of the Python fields to initialize the Rust struct.
This commit is contained in:
parent
b4b59df5e4
commit
23813577d1
2 changed files with 15 additions and 11 deletions
|
@ -171,9 +171,9 @@ pub struct NativeProperties {
|
|||
/// Constants for the interface.
|
||||
pub consts: Option<&'static [ConstantSpec]>,
|
||||
/// Static methods for the interface.
|
||||
pub staticMethods: Option<&'static [JSFunctionSpec]>,
|
||||
pub static_methods: Option<&'static [JSFunctionSpec]>,
|
||||
/// Static attributes for the interface.
|
||||
pub staticAttrs: Option<&'static [JSPropertySpec]>,
|
||||
pub static_attrs: Option<&'static [JSPropertySpec]>,
|
||||
}
|
||||
unsafe impl Sync for NativeProperties {}
|
||||
|
||||
|
@ -226,13 +226,17 @@ fn CreateInterfaceObject(cx: *mut JSContext, global: *mut JSObject, receiver: *m
|
|||
let constructor = JS_GetFunctionObject(fun);
|
||||
assert!(!constructor.is_null());
|
||||
|
||||
match members.staticMethods {
|
||||
Some(staticMethods) => DefineMethods(cx, constructor, staticMethods),
|
||||
match members.static_methods {
|
||||
Some(static_methods) => {
|
||||
DefineMethods(cx, constructor, static_methods)
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
|
||||
match members.staticAttrs {
|
||||
Some(staticProperties) => DefineProperties(cx, constructor, staticProperties),
|
||||
match members.static_attrs {
|
||||
Some(static_properties) => {
|
||||
DefineProperties(cx, constructor, static_properties)
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue