mirror of
https://github.com/servo/servo.git
synced 2025-06-16 20:34:30 +00:00
Remove some dead code from CGCreateInterfaceObjectsMethod.
This commit is contained in:
parent
cfbcb5c62b
commit
14f679d455
1 changed files with 1 additions and 33 deletions
|
@ -2675,38 +2675,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
# if we don't need to create anything, why are we generating this?
|
# if we don't need to create anything, why are we generating this?
|
||||||
assert needInterfaceObject or needInterfacePrototypeObject
|
assert needInterfaceObject or needInterfacePrototypeObject
|
||||||
|
|
||||||
idsToInit = []
|
|
||||||
if False: #XXXjdm don't need xray stuff yet
|
|
||||||
for var in self.properties.xrayRelevantArrayNames():
|
|
||||||
props = getattr(self.properties, var)
|
|
||||||
# We only have non-chrome ids to init if we have no chrome ids.
|
|
||||||
if props.hasChromeOnly():
|
|
||||||
idsToInit.append(props.variableName(True))
|
|
||||||
elif props.hasNonChromeOnly():
|
|
||||||
idsToInit.append(props.variableName(False))
|
|
||||||
if len(idsToInit) > 0:
|
|
||||||
setup = CGList([CGGeneric("let page = page_from_context(aCx);"),
|
|
||||||
CGList([CGGeneric("let mut js_info = (*page).js_info();\n"
|
|
||||||
"let %s_ids_mut = js_info.get().get_ref().dom_static.attribute_ids.get(&(PrototypeList::id::%s as uint));" % (varname, self.descriptor.name)) for varname in idsToInit], '\n')], '\n')
|
|
||||||
initIds = CGList(
|
|
||||||
[CGGeneric("!InitIds(aCx, %s, *%s_ids_mut)" % (varname, varname)) for
|
|
||||||
varname in idsToInit], ' ||\n')
|
|
||||||
if len(idsToInit) > 1:
|
|
||||||
initIds = CGWrapper(initIds, pre="(", post=")", reindent=True)
|
|
||||||
initIds = CGList(
|
|
||||||
[CGGeneric("%s_ids_mut[0] == JSID_VOID &&" % idsToInit[0]), initIds],
|
|
||||||
"\n")
|
|
||||||
initIds = CGWrapper(initIds, pre="if ", post=" {", reindent=True)
|
|
||||||
initIds = CGList(
|
|
||||||
[setup,
|
|
||||||
initIds,
|
|
||||||
CGGeneric((" %s_ids_mut[0] = JSID_VOID;\n"
|
|
||||||
" return ptr::null();") % idsToInit[0]),
|
|
||||||
CGGeneric("}")],
|
|
||||||
"\n")
|
|
||||||
else:
|
|
||||||
initIds = None
|
|
||||||
|
|
||||||
prefCacheData = []
|
prefCacheData = []
|
||||||
for var in self.properties.arrayNames():
|
for var in self.properties.arrayNames():
|
||||||
props = getattr(self.properties, var)
|
props = getattr(self.properties, var)
|
||||||
|
@ -2773,7 +2741,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
chrome = None
|
chrome = None
|
||||||
|
|
||||||
functionBody = CGList(
|
functionBody = CGList(
|
||||||
[CGGeneric(getParentProto), initIds, prefCache, chrome,
|
[CGGeneric(getParentProto), prefCache, chrome,
|
||||||
CGGeneric(call % self.properties.variableNames(False))],
|
CGGeneric(call % self.properties.variableNames(False))],
|
||||||
"\n\n")
|
"\n\n")
|
||||||
#return CGIndenter(CGWrapper(functionBody, pre="/*", post="*/return ptr::null()")).define()
|
#return CGIndenter(CGWrapper(functionBody, pre="/*", post="*/return ptr::null()")).define()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue