Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the MozMap type. #13332

Merged
merged 7 commits into from Sep 21, 2016

Handle unsupported types better in getUnionTypeTemplateVars.

  • Loading branch information
Ms2ger committed Sep 21, 2016
commit e942f50e1b4bf854c8326ac3260b72c149652ce1
@@ -3989,13 +3989,6 @@ def stringDecl(const):


def getUnionTypeTemplateVars(type, descriptorProvider):
# For dictionaries and sequences we need to pass None as the failureCode
# for getJSToNativeConversionInfo.
# Also, for dictionaries we would need to handle conversion of
# null/undefined to the dictionary correctly.
if type.isDictionary():
raise TypeError("Can't handle dictionaries in unions")

if type.isGeckoInterface():
name = type.inner.identifier.name
typeName = descriptorProvider.getDescriptor(name).returnType
@@ -4006,10 +3999,6 @@ def getUnionTypeTemplateVars(type, descriptorProvider):
name = type.name
inner = getUnionTypeTemplateVars(innerSequenceType(type), descriptorProvider)
typeName = "Vec<" + inner["typeName"] + ">"
elif type.isArray():
name = str(type)
# XXXjdm dunno about typeName here
typeName = "/*" + type.name + "*/"
elif type.isByteString():
name = type.name
typeName = "ByteString"
@@ -4023,8 +4012,7 @@ def getUnionTypeTemplateVars(type, descriptorProvider):
name = type.name
typeName = builtinNames[type.tag()]
else:
name = type.name
typeName = "/*" + type.name + "*/"
raise TypeError("Can't handle %s in unions yet" % type)

info = getJSToNativeConversionInfo(
type, descriptorProvider, failureCode="return Ok(None);",
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.