mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Allow union types to be used as return values
This commit is contained in:
parent
1184b500e5
commit
7843b7b317
4 changed files with 28 additions and 8 deletions
|
@ -1002,6 +1002,11 @@ def getRetvalDeclarationForType(returnType, descriptorProvider):
|
|||
if returnType.nullable():
|
||||
result = CGWrapper(result, pre="Option<", post=">")
|
||||
return result
|
||||
if returnType.isUnion():
|
||||
result = CGGeneric('%s::%s' % (returnType.unroll().name, returnType.unroll().name))
|
||||
if returnType.nullable():
|
||||
result = CGWrapper(result, pre="Option<", post=">")
|
||||
return result
|
||||
if returnType.isAny():
|
||||
return CGGeneric("JSVal")
|
||||
if returnType.isObject() or returnType.isSpiderMonkeyInterface():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue