diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-11-09 21:30:41 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-11-12 13:32:53 +0100 |
commit | 803cd4b7cfa0e846d5fa89be04ef4140e6f1a7d2 (patch) | |
tree | ce2deda718150aeffbd8826a4550b2ada9f34f34 /src/components/script/dom/bindings/codegen/CodegenRust.py | |
parent | 2975cb69e3bb4784647a5b7f6d5d4dac7b8241cf (diff) | |
download | servo-803cd4b7cfa0e846d5fa89be04ef4140e6f1a7d2.tar.gz servo-803cd4b7cfa0e846d5fa89be04ef4140e6f1a7d2.zip |
Make DOMString represent a non-nullable string.
Diffstat (limited to 'src/components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 9f333ca6e75..c1739f1c13c 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -1110,10 +1110,10 @@ for (uint32_t i = 0; i < length; ++i) { declType, None, isOptional, None) if isOptional: - declType = "Option<DOMString>" + declType = "Option<Option<DOMString>>" initialValue = "None" else: - declType = "DOMString" + declType = "Option<DOMString>" initialValue = None return ( @@ -1722,7 +1722,7 @@ def getRetvalDeclarationForType(returnType, descriptorProvider, result = CGWrapper(result, pre="Nullable<", post=">") return result, False if returnType.isString(): - return CGGeneric("DOMString"), False + return CGGeneric("Option<DOMString>"), False if returnType.isEnum(): if returnType.nullable(): raise TypeError("We don't support nullable enum return values") @@ -2960,8 +2960,8 @@ 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<DOMString> by reference. If only one of optional or - # defaultValue are truthy we pass an Option, otherwise it's a concrete DOMString. + # 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)): name = "&" + name args.append(CGGeneric(name)) |