MCPcopy
hub / github.com/postcss/postcss / visitSync

Method visitSync

lib/lazy-result.js:456–472  ·  view source on GitHub ↗
(visitors, node)

Source from the content-addressed store, hash-verified

454 }
455
456 visitSync(visitors, node) {
457 for (let [plugin, visitor] of visitors) {
458 this.result.lastPlugin = plugin
459 let promise
460 try {
461 promise = visitor(node, this.helpers)
462 } catch (e) {
463 throw this.handleError(e, node.proxyOf)
464 }
465 if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
466 return true
467 }
468 if (isPromise(promise)) {
469 throw this.getAsyncError()
470 }
471 }
472 }
473
474 visitTick(stack) {
475 let visit = stack[stack.length - 1]

Callers 2

syncMethod · 0.95
walkSyncMethod · 0.95

Calls 3

handleErrorMethod · 0.95
getAsyncErrorMethod · 0.95
isPromiseFunction · 0.85

Tested by

no test coverage detected