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

Method get

object.go:1430–1439  ·  view source on GitHub ↗
(p Value, receiver Value)

Source from the content-addressed store, hash-verified

1428}
1429
1430func (o *Object) get(p Value, receiver Value) Value {
1431 switch p := p.(type) {
1432 case valueInt:
1433 return o.self.getIdx(p, receiver)
1434 case *Symbol:
1435 return o.self.getSym(p, receiver)
1436 default:
1437 return o.self.getStr(p.string(), receiver)
1438 }
1439}
1440
1441func (o *Object) getOwnProp(p Value) Value {
1442 switch p := p.(type) {

Callers 2

BenchmarkArrayGetFunction · 0.95
BenchmarkGetFunction · 0.95

Calls 4

getIdxMethod · 0.65
getSymMethod · 0.65
getStrMethod · 0.65
stringMethod · 0.65

Tested by 2

BenchmarkArrayGetFunction · 0.76
BenchmarkGetFunction · 0.76