MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / TreeProcessor

Function TreeProcessor

ui/plugins/ui/jasmine/jasmine.js:9571–9810  ·  view source on GitHub ↗
(attrs)

Source from the content-addressed store, hash-verified

9569
9570getJasmineRequireObj().TreeProcessor = function() {
9571 function TreeProcessor(attrs) {
9572 const tree = attrs.tree
9573 const runnableIds = attrs.runnableIds
9574 const queueRunnerFactory = attrs.queueRunnerFactory
9575 const nodeStart = attrs.nodeStart || function() {}
9576 const nodeComplete = attrs.nodeComplete || function() {}
9577 const failSpecWithNoExpectations = !!attrs.failSpecWithNoExpectations
9578 const orderChildren =
9579 attrs.orderChildren ||
9580 function(node) {
9581 return node.children
9582 }
9583 const excludeNode =
9584 attrs.excludeNode ||
9585 function(node) {
9586 return false
9587 }
9588 let stats = { valid: true }
9589 let processed = false
9590 const defaultMin = Infinity
9591 const defaultMax = 1 - Infinity
9592
9593 this.processTree = function() {
9594 processNode(tree, true)
9595 processed = true
9596 return stats
9597 }
9598
9599 this.execute = async function() {
9600 if (!processed) {
9601 this.processTree()
9602 }
9603
9604 if (!stats.valid) {
9605 throw "invalid order"
9606 }
9607
9608 const childFns = wrapChildren(tree, 0)
9609
9610 await new Promise(function(resolve) {
9611 queueRunnerFactory({
9612 queueableFns: childFns,
9613 userContext: tree.sharedUserContext(),
9614 onException: function() {
9615 tree.handleException.apply(tree, arguments)
9616 },
9617 onComplete: resolve,
9618 onMultipleDone: tree.onMultipleDone ? tree.onMultipleDone.bind(tree) : null,
9619 })
9620 })
9621 }
9622
9623 function runnableIndex(id) {
9624 for (let i = 0; i < runnableIds.length; i++) {
9625 if (runnableIds[i] === id) {
9626 return i
9627 }
9628 }

Callers

nothing calls this directly

Calls 4

processNodeFunction · 0.85
wrapChildrenFunction · 0.85
queueRunnerFactoryFunction · 0.85
bindMethod · 0.45

Tested by

no test coverage detected