mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
Reorganise CGDescriptor
Group some codegen operations together.
This commit is contained in:
parent
ce79e04644
commit
fce0a8e7cf
1 changed files with 19 additions and 23 deletions
|
@ -5628,13 +5628,6 @@ class CGDescriptor(CGThing):
|
|||
return name
|
||||
|
||||
cgThings = []
|
||||
if not descriptor.interface.isCallback() and not descriptor.interface.isNamespace():
|
||||
cgThings.append(CGGetProtoObjectMethod(descriptor))
|
||||
reexports.append('GetProtoObject')
|
||||
if (descriptor.interface.hasInterfaceObject() and
|
||||
descriptor.shouldHaveGetConstructorObjectMethod()):
|
||||
cgThings.append(CGGetConstructorObjectMethod(descriptor))
|
||||
reexports.append('GetConstructorObject')
|
||||
|
||||
unscopableNames = []
|
||||
for m in descriptor.interface.members:
|
||||
|
@ -5681,17 +5674,6 @@ class CGDescriptor(CGThing):
|
|||
cgThings.append(CGClassFinalizeHook(descriptor))
|
||||
cgThings.append(CGClassTraceHook(descriptor))
|
||||
|
||||
if descriptor.interface.hasInterfaceObject():
|
||||
if descriptor.interface.ctor():
|
||||
cgThings.append(CGClassConstructHook(descriptor))
|
||||
for ctor in descriptor.interface.namedConstructors:
|
||||
cgThings.append(CGClassConstructHook(descriptor, ctor))
|
||||
if not descriptor.interface.isCallback():
|
||||
cgThings.append(CGInterfaceObjectJSClass(descriptor))
|
||||
|
||||
if not descriptor.interface.isCallback() and not descriptor.interface.isNamespace():
|
||||
cgThings.append(CGPrototypeJSClass(descriptor))
|
||||
|
||||
# If there are no constant members, don't make a module for constants
|
||||
constMembers = [m for m in descriptor.interface.members if m.isConst()]
|
||||
if constMembers:
|
||||
|
@ -5700,11 +5682,6 @@ class CGDescriptor(CGThing):
|
|||
public=True))
|
||||
reexports.append(descriptor.name + 'Constants')
|
||||
|
||||
if descriptor.interface.hasInterfaceObject() and descriptor.register:
|
||||
cgThings.append(CGDefineDOMInterfaceMethod(descriptor))
|
||||
reexports.append('DefineDOMInterface')
|
||||
cgThings.append(CGConstructorEnabled(descriptor))
|
||||
|
||||
if descriptor.proxy:
|
||||
cgThings.append(CGDefineProxyHandler(descriptor))
|
||||
|
||||
|
@ -5766,6 +5743,25 @@ class CGDescriptor(CGThing):
|
|||
cgThings.append(CGWeakReferenceableTrait(descriptor))
|
||||
|
||||
cgThings.append(CGGeneric(str(properties)))
|
||||
|
||||
if not descriptor.interface.isCallback() and not descriptor.interface.isNamespace():
|
||||
cgThings.append(CGGetProtoObjectMethod(descriptor))
|
||||
reexports.append('GetProtoObject')
|
||||
cgThings.append(CGPrototypeJSClass(descriptor))
|
||||
if descriptor.interface.hasInterfaceObject():
|
||||
if descriptor.interface.ctor():
|
||||
cgThings.append(CGClassConstructHook(descriptor))
|
||||
for ctor in descriptor.interface.namedConstructors:
|
||||
cgThings.append(CGClassConstructHook(descriptor, ctor))
|
||||
if not descriptor.interface.isCallback():
|
||||
cgThings.append(CGInterfaceObjectJSClass(descriptor))
|
||||
if descriptor.shouldHaveGetConstructorObjectMethod():
|
||||
cgThings.append(CGGetConstructorObjectMethod(descriptor))
|
||||
reexports.append('GetConstructorObject')
|
||||
if descriptor.register:
|
||||
cgThings.append(CGDefineDOMInterfaceMethod(descriptor))
|
||||
reexports.append('DefineDOMInterface')
|
||||
cgThings.append(CGConstructorEnabled(descriptor))
|
||||
cgThings.append(CGCreateInterfaceObjectsMethod(descriptor, properties, haveUnscopables))
|
||||
|
||||
cgThings = generate_imports(config, CGList(cgThings, '\n'), [descriptor])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue