Share a little less code between the branches for conversion to any.

This commit is contained in:
Ms2ger 2017-02-14 13:59:07 +01:00
parent 7d24cd7752
commit 5eaa19bdd4

View file

@ -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: