MCPcopy Index your code
hub / github.com/evcc-io/evcc / handleSetter

Method handleSetter

plugin/javascript.go:131–150  ·  view source on GitHub ↗
(param string, val any)

Source from the content-addressed store, hash-verified

129}
130
131func (p *Javascript) handleSetter(param string, val any) error {
132 if err := transformInputs(p.in, p.setParamSync); err != nil {
133 return err
134 }
135
136 javascript.Lock()
137 if err := p.setParam(param, val); err != nil {
138 javascript.Unlock()
139 return err
140 }
141
142 v, err := p.evaluate()
143 if err != nil {
144 javascript.Unlock()
145 return err
146 }
147
148 javascript.Unlock()
149 return transformOutputs(p.out, v)
150}
151
152func (p *Javascript) evaluate() (res any, err error) {
153 defer func() {

Callers 4

IntSetterMethod · 0.95
FloatSetterMethod · 0.95
StringSetterMethod · 0.95
BoolSetterMethod · 0.95

Calls 6

setParamMethod · 0.95
evaluateMethod · 0.95
LockFunction · 0.92
UnlockFunction · 0.92
transformInputsFunction · 0.85
transformOutputsFunction · 0.85

Tested by

no test coverage detected