MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / direct_sibling

Function direct_sibling

MathBox/mathbox-core.js:319–337  ·  view source on GitHub ↗
(node, next, subj)

Source from the content-addressed store, hash-verified

317 }
318
319 function direct_sibling(node, next, subj) {
320 var parent = options.parent(node)
321 , idx = 0
322 , children
323
324 children = options.children(parent)
325
326 for(var i = 0, len = children.length; i < len; ++i) {
327 if(children[i] === node) {
328 idx = i
329
330 break
331 }
332 }
333
334 return children[idx - 1] && next(children[idx - 1], subj) ?
335 children[idx - 1] :
336 null
337 }
338
339 function any_sibling(node, next, subj) {
340 var parent = options.parent(node)

Callers

nothing calls this directly

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected