mirror of
https://github.com/servo/servo.git
synced 2025-06-11 01:50:10 +00:00
Move the assignment of 'None' in the no-argument-passed case into an else branch.
This is the only case where we assign into an argument local twice, so removing it will allow us to make that binding immutable.
This commit is contained in:
parent
cb2723c4ed
commit
d14efebb5c
1 changed files with 3 additions and 3 deletions
|
@ -829,8 +829,6 @@ def instantiateJSToNativeConversionTemplate(templateTuple, replacements,
|
|||
CGGeneric(replacements["declName"]),
|
||||
CGGeneric(": "),
|
||||
declType]
|
||||
if dealWithOptional:
|
||||
newDecl.append(CGGeneric(" = None"))
|
||||
newDecl.append(CGGeneric(";"))
|
||||
result.append(CGList(newDecl))
|
||||
conversion = CGWrapper(conversion,
|
||||
|
@ -839,7 +837,9 @@ def instantiateJSToNativeConversionTemplate(templateTuple, replacements,
|
|||
|
||||
if argcAndIndex is not None:
|
||||
condition = string.Template("${index} < ${argc}").substitute(argcAndIndex)
|
||||
conversion = CGIfWrapper(conversion, condition)
|
||||
conversion = CGIfElseWrapper(condition,
|
||||
conversion,
|
||||
CGGeneric("%s = None" % replacements["declName"]))
|
||||
|
||||
result.append(conversion)
|
||||
# Add an empty CGGeneric to get an extra newline after the argument
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue