MCPcopy Create free account
hub / github.com/dop251/goja / newCode

Method newCode

compiler_expr.go:1310–1321  ·  view source on GitHub ↗
(length, minCap int)

Source from the content-addressed store, hash-verified

1308}
1309
1310func (c *compiler) newCode(length, minCap int) (buf []instruction) {
1311 if c.codeScratchpad != nil {
1312 buf = c.codeScratchpad
1313 c.codeScratchpad = nil
1314 }
1315 if cap(buf) < minCap {
1316 buf = make([]instruction, length, minCap)
1317 } else {
1318 buf = buf[:length]
1319 }
1320 return
1321}
1322
1323func (e *compiledFunctionLiteral) compile() (prg *Program, name unistring.String, length int, strict bool) {
1324 e.c.assert(e.typ != funcNone, e.offset, "compiledFunctionLiteral.typ is not set")

Callers 2

compileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected