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

Method setOwn

object.go:1521–1530  ·  view source on GitHub ↗
(name Value, val Value, throw bool)

Source from the content-addressed store, hash-verified

1519}
1520
1521func (o *Object) setOwn(name Value, val Value, throw bool) bool {
1522 switch name := name.(type) {
1523 case valueInt:
1524 return o.self.setOwnIdx(name, val, throw)
1525 case *Symbol:
1526 return o.self.setOwnSym(name, val, throw)
1527 default:
1528 return o.self.setOwnStr(name.string(), val, throw)
1529 }
1530}
1531
1532func (o *Object) setIdx(name valueInt, val, receiver Value, throw bool) bool {
1533 if receiver == o {

Callers 12

BenchmarkArrayGetStrFunction · 0.95
BenchmarkArrayGetFunction · 0.95
BenchmarkArrayPutFunction · 0.95
BenchmarkPutFunction · 0.95
setMethod · 0.80
initMethod · 0.80
execMethod · 0.80
execMethod · 0.80
execMethod · 0.80
execMethod · 0.80
execMethod · 0.80
object_assignMethod · 0.80

Calls 4

setOwnIdxMethod · 0.65
setOwnSymMethod · 0.65
setOwnStrMethod · 0.65
stringMethod · 0.65

Tested by 4

BenchmarkArrayGetStrFunction · 0.76
BenchmarkArrayGetFunction · 0.76
BenchmarkArrayPutFunction · 0.76
BenchmarkPutFunction · 0.76