(encoding, commandList, stub, feature)
| 346 | // ======================================== |
| 347 | |
| 348 | function makeHandler(encoding, commandList, stub, feature) { |
| 349 | return function (evt) { |
| 350 | var data = decode(evt.data, encoding); |
| 351 | var context = feature.runtime.makeContext(stub, feature, stub); |
| 352 | context.event = evt; |
| 353 | context.result = data; |
| 354 | commandList.execute(context); |
| 355 | }; |
| 356 | } |
| 357 | |
| 358 | function decode(data, encoding) { |
| 359 | if (encoding.toLowerCase() === "json") { |
no test coverage detected