mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Share a little less code between the branches for conversion to any.
This commit is contained in:
parent
7d24cd7752
commit
5eaa19bdd4
1 changed files with 11 additions and 12 deletions
|
@ -1032,8 +1032,6 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
if type.isAny():
|
if type.isAny():
|
||||||
assert not isEnforceRange and not isClamp
|
assert not isEnforceRange and not isClamp
|
||||||
|
|
||||||
declType = ""
|
|
||||||
default = ""
|
|
||||||
if isMember == "Dictionary":
|
if isMember == "Dictionary":
|
||||||
# TODO: Need to properly root dictionaries
|
# TODO: Need to properly root dictionaries
|
||||||
# https://github.com/servo/servo/issues/6381
|
# https://github.com/servo/servo/issues/6381
|
||||||
|
@ -1047,7 +1045,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
default = "UndefinedValue()"
|
default = "UndefinedValue()"
|
||||||
else:
|
else:
|
||||||
raise TypeError("Can't handle non-null, non-undefined default value here")
|
raise TypeError("Can't handle non-null, non-undefined default value here")
|
||||||
else:
|
return handleOptional("${val}", declType, default)
|
||||||
|
|
||||||
declType = CGGeneric("HandleValue")
|
declType = CGGeneric("HandleValue")
|
||||||
|
|
||||||
if defaultValue is None:
|
if defaultValue is None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue