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

Method slice

parser/parser.go:201–209  ·  view source on GitHub ↗
(idx0, idx1 file.Idx)

Source from the content-addressed store, hash-verified

199}
200
201func (self *_parser) slice(idx0, idx1 file.Idx) string {
202 from := int(idx0) - self.base
203 to := int(idx1) - self.base
204 if from >= 0 && to <= len(self.str) {
205 return self.str[from:to]
206 }
207
208 return ""
209}
210
211func (self *_parser) parse() (*ast.Program, error) {
212 self.openScope()

Callers 6

parseMethodDefinitionMethod · 0.95
parseArrowFunctionMethod · 0.95
parseFunctionMethod · 0.95
parseClassMethod · 0.95
TestParserErrFunction · 0.80
TestPositionFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestParserErrFunction · 0.64
TestPositionFunction · 0.64