aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 05255b95792..bb87667df83 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -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))