kriskowal/q-comm — Issue #6: Difficult to debug failure mode: undefined local object
Author: johnjbarton
Created: 2012-02-07 18:27:14+00:00
State: open

Due to a bug in my code I called
Connection(connection, local, options)
with local === undefined.

The result was a error much later on
"post": function (name, value) {
return object[name].apply(object, value);
},
Where we get 'type error' because 'object' is undefined. Because object was closed over from an argument backtracking it was not straight forward.

I think the API would be better if {} rather than "undefined" meant "don't have a local API"