MCPcopy Create free account
hub / github.com/nodejs/node / SeekToNode

Function SeekToNode

tools/gyp/tools/pretty_vcproj.py:227–246  ·  view source on GitHub ↗
(node1, child2)

Source from the content-addressed store, hash-verified

225
226
227def SeekToNode(node1, child2):
228 # A text node does not have properties.
229 if child2.nodeType == Node.TEXT_NODE:
230 return None
231
232 # Get the name of the current node.
233 current_name = child2.getAttribute("Name")
234 if not current_name:
235 # There is no name. We don't know how to merge.
236 return None
237
238 # Look through all the nodes to find a match.
239 for sub_node in node1.childNodes:
240 if sub_node.nodeName == child2.nodeName:
241 name = sub_node.getAttribute("Name")
242 if name == current_name:
243 return sub_node
244
245 # No match. We give up.
246 return None
247
248
249def MergeAttributes(node1, node2):

Callers 1

MergePropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected