mirror of
https://github.com/servo/servo.git
synced 2025-06-12 10:24:43 +00:00
Simplify how Prefable arrays are passed in bindings::interface
This commit is contained in:
parent
bee6f59b16
commit
adcecda047
2 changed files with 19 additions and 26 deletions
|
@ -2531,15 +2531,10 @@ assert!(!prototype_proto.ptr.is_null());""" % getPrototypeProto)]
|
|||
properties = {"id": name}
|
||||
for arrayName in self.properties.arrayNames():
|
||||
array = getattr(self.properties, arrayName)
|
||||
if arrayName == "consts":
|
||||
if array.length():
|
||||
properties[arrayName] = array.variableName()
|
||||
else:
|
||||
properties[arrayName] = "&[]"
|
||||
elif array.length():
|
||||
properties[arrayName] = "Some(%s)" % array.variableName()
|
||||
if array.length():
|
||||
properties[arrayName] = array.variableName()
|
||||
else:
|
||||
properties[arrayName] = "None"
|
||||
properties[arrayName] = "&[]"
|
||||
|
||||
code.append(CGGeneric("""
|
||||
let mut prototype = RootedObject::new(cx, ptr::null_mut());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue