Ringobot log - RingoJS IRC channel: #ringojs on irc.freenode.net

2010-07-26:

[17:58] <oravecz> anyone familiar with httpclient online?
[20:35] <oravecz> here's a weird one, I'm using http client to make calls against a rest server
[20:35] <oravecz> When I use async and call wait(), my servlet is invoked three times for every async call I make
[20:36] <oravecz> works fine, if I set async=false
[20:55] <oravecz> ok, it looks like my problem is simpler. It just appears that wait() isn't working...
[21:20] <oravecz> The httpclient returns an object that contains a wait() function. I would like to override that function with my own implementation. However, typical JS (i.e. request.wait = function() {} )is not allowing me to replace the function. Does this have something to do with Object.defineProperties? Do I have to override properties set that way differently than typical JS properties?
[21:23] <oravecz> Solo IRC conversations are no fun :(
[21:25] <oravecz> OK, it looks like the request object returned by the httpclient.js has all of its properties set as "not writeable", so I can't replace them with my own calls without re-wrapping the whole object. You only get this error when you try to overwrite the property using Object.defineProperties(). Just trying to replace the property directly fails silently. Insidious.