MCPcopy
hub / github.com/gopherjs/gopherjs / CatchOutput

Method CatchOutput

compiler/utils.go:99–109  ·  view source on GitHub ↗
(indent int, f func())

Source from the content-addressed store, hash-verified

97}
98
99func (fc *funcContext) CatchOutput(indent int, f func()) []byte {
100 origoutput := fc.output
101 fc.output = nil
102 fc.pkgCtx.indentation += indent
103 f()
104 fc.writePos()
105 caught := fc.output
106 fc.output = origoutput
107 fc.pkgCtx.indentation -= indent
108 return caught
109}
110
111func (fc *funcContext) Delayed(f func()) {
112 fc.delayedOutput = fc.CatchOutput(0, f)

Callers 8

DelayedMethod · 0.95
translateFunctionBodyMethod · 0.95
newImportDeclMethod · 0.95
newVarDeclMethod · 0.95
funcDeclsMethod · 0.95
newFuncDeclMethod · 0.95
newNamedTypeVarDeclMethod · 0.95
newNamedTypeInstDeclMethod · 0.95

Calls 1

writePosMethod · 0.95

Tested by

no test coverage detected