Opened 10 years ago

Closed 10 years ago

#13641 closed defect (invalid)

[patch] change local variable name of kernel to dojo in dojo/_base/connect

Reported by: zhangyp Owned by:
Priority: high Milestone: tbd
Component: Core Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Chris Mitchell)

This patch changes local variable name of kernel to dojo in dojo/_base/connect. It passed unit test dojo/tests/_base/connect.js after the patch was applied.

Attachments (1)

connect.patch (2.6 KB) - added by zhangyp 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by zhangyp

Attachment: connect.patch added

comment:1 Changed 10 years ago by bill

Why would we want to do that?

If it says "dojo" it's hard to tell whether the file has been converted to baseless or not. If it says "kernel" it suggests that the variable is being referenced just for the stuff defined in dojo/_base/kernel. That's why all the dijit files that are accessing stuff in dojo/_base/kernel reference it through a variable called kernel.

Admittedly, the stuff in the dojo/ core directory is a little special since it exports symbols to the dojo namespace.

comment:2 Changed 10 years ago by zhangyp

For tracking of the baseless refactor, we can check spreadsheet at here.

"kernel" would suggest that we are using a local variable which only contains the stuff defined in dojo/_base/kernel but it is actually the global dojo variable and contains stuff defined in other modules which is attached to dojo. I think we need to keep the name consistent and prevent causing any kind of confusion by different names.

comment:3 Changed 10 years ago by Chris Mitchell

Description: modified (diff)
Resolution: invalid
Status: newclosed

when we do baseless AMD conversion, we are using local variable references. In this case, using the name "kernel" is fine (and preferred) since this module has been converted. It also helps ensure that the global "dojo" is not used by accident. Closing this ticket as invalid.

Note: See TracTickets for help on using tickets.