Opened 9 years ago

Closed 9 years ago

#11474 closed defect (invalid)

dojox.json.query refers to its namespace using "this"

Reported by: Eugene Lazutkin Owned by: Kris Zyp
Priority: low Milestone: tbd
Component: Dojox Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

While migrating from 1.4 to 1.5 I've noticed that dojox.json.query refers to its namespace using this in the last line of its code. This is an example of a broken code:

var q = dojox.json.query;
//...
q(/*...*/);

This problem came up before, and, after discussion, it was decided that we use this to refer to object instances, but not to namespaces --- to facilitate safe and predictable aliasing of namespaces, "classes", stand-alone functions, and other singletons.

Change History (2)

comment:1 Changed 9 years ago by Kris Zyp

AFAICT, the executor functions (the target that we are apply-ing |this| to) doesn't actually ever use |this|. It seems like queries work properly for me. Do you have an example of a failure? The example listed in the ticket doesn't include any error messages.

comment:2 Changed 9 years ago by Eugene Lazutkin

Resolution: invalid
Status: newclosed

The problem was seen in a big production project while migrating from 1.4.2 to 1.5.0. Since that time the code was changed and the aliasing was removed.

Looking at the executor code I don't see any references to this so let's chalk it up on buggy firefox/firebug.

Note: See TracTickets for help on using tickets.