Stop passing DOMStrings via borrowed pointer. (#1201)

This commit is contained in:
Tetsuharu OHZEKI 2013-11-09 03:55:30 +09:00
parent b1762655e6
commit f5ef4365f4
74 changed files with 364 additions and 366 deletions

View file

@ -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))