Opened 13 years ago

Closed 13 years ago

#1934 closed defect (fixed)

Syntax error in compressed dojo.js file; current download version 0.4

Reported by: guest Owned by: jkuhnert
Priority: high Milestone:
Component: General Version: 0.4
Keywords: Cc:
Blocked By: Blocking:

Description

There is a syntax problem in the compressed dojo.js file for version 0.4. It is on line 3465. This line contains an ending semi-colon, when it shouldn't. I found this when it threw a run-time JS error.

The following is an excerpt from the compressed dojo.js file in version 0.4: / var _32b=function(){ if(this.squelch){ try{ return _31b.apply(this,arguments); } catch(e){ dojo.debug(e); } }else{ return _31b.apply(this,arguments); } }; <==BAD LINE!!!! There should be NO SEMI-COLON HERE!!! if((thisbefore?)&&(this.before.length>0)){ dojo.lang.forEach(this.before.concat(new Array()),_32b); }

The following is the same code segment in the uncompressed dojo.js file: var unRollSquelch = function(){

if(this.squelch){

try{

return unrollAdvice.apply(this, arguments);

}catch(e){

dojo.debug(e);

}

}else{

return unrollAdvice.apply(this, arguments);

}

} <==CORRECT LINE :)

if((thisbefore?)&&(this.before.length>0)){ pass a cloned array, if this event disconnects...

dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);

}

As you can see, there should be no ending semi-colon on line 3465 of the compressed version of dojo.js for version 0.4.

I hope this helps. Maybe in return for finding and reporting this bug, you guys could do a better job on documenting your products? Great work never gets utilized as well as it could if it's poorly and/or shallowly documented.

~CMOR (cmor at halotl dot com)

Change History (3)

comment:1 Changed 13 years ago by bill

This is line #700 from event/common.js (see http://trac.dojotoolkit.org/browser/trunk/src/event/common.js?rev=6392)

There's no semicolon in the original source, but I'm not sure whether or not there should be. Usually assignments have semicolons:

  var x=5;

Not sure why functions should be different.

   var x=function(){ ... } ;

comment:2 Changed 13 years ago by bill

Owner: changed from anonymous to jkuhnert

comment:3 Changed 13 years ago by jkuhnert

Resolution: fixed
Status: newclosed

(In [6866]) Fixes #1934. It's giving me a slight anurism from pure fear of touching such a critical component of the system but on the other hand having a ; at the end of a var = foo kind of statement ~is~ technically legal so I may do it just this once. I'll forward an email to Alex to help cya prevention anyways.

Note: See TracTickets for help on using tickets.