(encoding, commandList, stub, feature)
| 320 | } |
| 321 | } |
| 322 | function makeHandler(encoding, commandList, stub, feature) { |
| 323 | return function(evt) { |
| 324 | var data = decode(evt.data, encoding); |
| 325 | var context = feature.runtime.makeContext(stub, feature, stub); |
| 326 | context.event = evt; |
| 327 | context.result = data; |
| 328 | commandList.execute(context); |
| 329 | }; |
| 330 | } |
| 331 | function decode(data, encoding) { |
| 332 | if (encoding.toLowerCase() === "json") { |
| 333 | return JSON.parse(data); |
no test coverage detected