The hasOwnProperty is just a bug, I fixed it at R1507. It causes
exactly the problem you found.

If you are not reusing the object, attach the property to it or the
prototype does not matter. If you are a "maybe I need it in future"
kind of person, then you have to make more decisions.

jjb

On Dec 18, 5:30 pm, Manoj <[email protected]> wrote:
> I have a minor problem with regards to using the dispatch() method in
> Firebug within my extension.
>
> In my extension, I have a network trace object which keeps track of
> the network request, matching response and also the associated
> response data.
>
> function NetworkTraceObject()
> {
>   // Define properties
>
> }
>
> NetworkTraceObject.prototype = extend(BaseTraceObject,
> {
>   // Define methods
>   toString: function()
>   {
>     return "object NetworkTraceObject";
>   },
>
>   ...
>
>   onResponseDataWriteComplete: function(status, fileName, fileLength)
>   {
>     ...
>   },
>
> });
>
> The response data is being collected by a seperate object with which
> the above object has been registered as a listener. The
> onResponseDataWriteComplete() function is supposed to be called (via
> dispatch()) when the response data related to this request has been
> completely received. Trouble is the check for "listener.hasOwnProperty
> ()" fails in dispatch() for "onResponseDataWriteComplete".
>
> What pattern should I be using to correctly define NetworkTraceObject?
> Is there any harm in defining onResponseDataWriteComplete() as a
> direct member of NetworkTraceObject() instead of putting it in the
> prototype?
>
> Come to think of it, I will probably make NetworkTraceObject register
> directly with nsITraceableChannel and avoid the extra intermediate
> object, but still would like to know if I'm doing anything wrong
> above.
>
> Regards,
> Manoj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to