mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement binding support for returning and accepting Promises in WebIDL.
This commit is contained in:
parent
73b2963509
commit
a1091772ec
12 changed files with 217 additions and 20 deletions
|
@ -194,9 +194,17 @@ class Descriptor(DescriptorProvider):
|
|||
|
||||
typeName = desc.get('nativeType', nativeTypeDefault)
|
||||
|
||||
# Callback types do not use JS smart pointers, so we should not use the
|
||||
spiderMonkeyInterface = desc.get('spiderMonkeyInterface', False)
|
||||
|
||||
# Callback and SpiderMonkey types do not use JS smart pointers, so we should not use the
|
||||
# built-in rooting mechanisms for them.
|
||||
if self.interface.isCallback():
|
||||
if spiderMonkeyInterface:
|
||||
self.needsRooting = False
|
||||
self.returnType = 'Rc<%s>' % typeName
|
||||
self.argumentType = '&%s' % typeName
|
||||
self.nativeType = typeName
|
||||
pathDefault = 'dom::types::%s' % typeName
|
||||
elif self.interface.isCallback():
|
||||
self.needsRooting = False
|
||||
ty = 'dom::bindings::codegen::Bindings::%sBinding::%s' % (ifaceName, ifaceName)
|
||||
pathDefault = ty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue