mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use ToJSValConvertible to convert nullable enums to JSVal.
This commit is contained in:
parent
ccaa46e4a3
commit
a52cffebeb
3 changed files with 5 additions and 5 deletions
|
@ -1089,9 +1089,6 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
|
|||
return (setValue("(%s).to_jsval(cx)" % result), True)
|
||||
|
||||
if type.isEnum():
|
||||
if type.nullable():
|
||||
raise TypeError("We don't support nullable enumerated return types "
|
||||
"yet")
|
||||
return (setValue("(%s).to_jsval(cx)" % result), True)
|
||||
|
||||
if type.isCallback():
|
||||
|
@ -1188,9 +1185,10 @@ def getRetvalDeclarationForType(returnType, descriptorProvider):
|
|||
result = CGWrapper(result, pre="Option<", post=">")
|
||||
return result
|
||||
if returnType.isEnum():
|
||||
result = CGGeneric(returnType.unroll().inner.identifier.name)
|
||||
if returnType.nullable():
|
||||
raise TypeError("We don't support nullable enum return values")
|
||||
return CGGeneric(returnType.inner.identifier.name)
|
||||
result = CGWrapper(result, pre="Option<", post=">")
|
||||
return result
|
||||
if returnType.isGeckoInterface():
|
||||
descriptor = descriptorProvider.getDescriptor(
|
||||
returnType.unroll().inner.identifier.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue