mirror of
https://github.com/servo/servo.git
synced 2025-06-12 18:34:39 +00:00
Rewrite the any unwrapping to return an expression.
This commit is contained in:
parent
1027801b04
commit
643ea874d1
1 changed files with 2 additions and 5 deletions
|
@ -767,11 +767,8 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
declType = CGWrapper(declType, pre="Option<", post=">")
|
||||
value = CGWrapper(value, pre="Some(", post=")")
|
||||
|
||||
templateBody = "${declName} = %s;" % value.define()
|
||||
templateBody = handleDefaultNull(templateBody,
|
||||
"${declName} = NullValue();")
|
||||
|
||||
return (templateBody, declType, None, isOptional, "None" if isOptional else None)
|
||||
templateBody = handleDefaultNull(value.define(), "NullValue()")
|
||||
return ("${declName} = " + templateBody + ";", declType, None, isOptional, "None" if isOptional else None)
|
||||
|
||||
if type.isObject():
|
||||
raise TypeError("Can't handle object arguments yet")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue