mirror of
https://github.com/servo/servo.git
synced 2025-06-15 20:04:28 +00:00
Stop passing DOMStrings via borrowed pointer. (#1201)
This commit is contained in:
parent
b1762655e6
commit
f5ef4365f4
74 changed files with 364 additions and 366 deletions
|
@ -1584,9 +1584,9 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
|
||||
if type.isString():
|
||||
if type.nullable():
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, &%s)" % result), False)
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, %s)" % result), False)
|
||||
else:
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = str_to_jsval(cx, &%s)" % result), False)
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = str_to_jsval(cx, %s)" % result), False)
|
||||
|
||||
if type.isEnum():
|
||||
if type.nullable():
|
||||
|
@ -2961,9 +2961,7 @@ class CGCallGenerator(CGThing):
|
|||
if a.type.isObject() and not a.type.nullable() and not a.optional:
|
||||
name = "(JSObject&)" + name
|
||||
#XXXjdm Perhaps we should pass all nontrivial types by borrowed pointer
|
||||
# Aoid passing Option<Option<DOMString>> by reference. If only one of optional or
|
||||
# defaultValue are truthy we pass an Option, otherwise it's a concrete Option<DOMString>.
|
||||
if a.type.isDictionary() or (a.type.isString() and not (bool(a.defaultValue) ^ a.optional)):
|
||||
if a.type.isDictionary():
|
||||
name = "&" + name
|
||||
args.append(CGGeneric(name))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue