Opened 14 years ago
Closed 14 years ago
#4396 closed defect (fixed)
dojox.validate.check.js references dj_undef() function, but dj_undef() is not defined
Reported by: | guest | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Dojox | Version: | 0.9 |
Keywords: | dojox.validate.check dj_undef | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description
dojox.validate.check.js uses the method/function dj_undef in several places (lines: 48, 56, 64, 72, 80, 91, 97, 135, 155, 175, 212). This method was used in 0.4.3, but seems to be phased out in 0.9. Currently the code fails trying to reference dj_undef. It either needs to be defined in check.js, or the above lines need to be changed not to use this function.
Here is the function dj_undef from 0.4.3
function dj_undef(name, object) {
return (typeof (object dj_currentContext)[name] == "undefined");
}
I've added this to check.js in my local copy, and it seems to work.
Attachments (1)
Change History (6)
comment:1 Changed 14 years ago by
Owner: | changed from Tom Trenka to dante |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
comment:4 Changed 14 years ago by
I suggest not using the dj_ names in the code. This was used in the 0.4 code for some "global" functions, but we've moved away from that in 0.9.
- dj_currentContext is now dojo.global
- dj_undef(name) can be accomplished via dojo.getObject(name)
getObject will use dojo.global internally. If you want to force a specific "global" (window object in the browser), you can use dojo.withGlobal() or dojo.getObject(name, false, yourGlobalHere).
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [10462]) dojox checkin fixes #4396 and $4397 - wrt to: #4396, its a quick and dirty solution using a local function to return undefined true / false. please reopen if is not robust enough or doesn't work for your scope, and will then implement jburke's suggestion of using dojo.getObject. need to fix unit tests badly, and obviously add a dojox.validate.check DOH test. any contributions welcome. ;)
not a problem to fix, though i want to ask first: what made dj_undef more robust than just checking typeof elm == "underfined" ? is the dj_currentContext important to the workings of dojox.validate.check (i'm unsure)? i can't/won't define dj_undef globally from a dojox module, so would do it locally, or just use a simple typeof check? is dj_currentContext still available? any ideas? i don't use dojox.validate, i just ported it ...