(encoding, commandList, stub, feature)
| 11842 | } |
| 11843 | } |
| 11844 | function makeHandler(encoding, commandList, stub, feature) { |
| 11845 | return function(evt) { |
| 11846 | var data = decode(evt.data, encoding); |
| 11847 | var context = feature.runtime.makeContext(stub, feature, stub); |
| 11848 | context.event = evt; |
| 11849 | context.result = data; |
| 11850 | commandList.execute(context); |
| 11851 | }; |
| 11852 | } |
| 11853 | function decode(data, encoding) { |
| 11854 | if (encoding.toLowerCase() === "json") { |
| 11855 | return JSON.parse(data); |
no test coverage detected