Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#8583 closed defect (fixed)

console.debug used in xhr.js; breaks in Safari 3.2.1/OS X 10.5.6

Reported by: dtgriscom Owned by: anonymous
Priority: high Milestone: 1.3
Component: General Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:


The error function at line 470 of xhr.js (dojo 1.2.3) uses console.debug, which breaks under Safari 3.2.1, as there's no debug method on the console. Should use or something else that's available. Only happens if there's a separate error, but that's when it shouldn't happen.

Change History (5)

comment:1 Changed 13 years ago by James Burke

If you use a standard release build, or do a custom build with stripConsole=normal, then you can avoid this issue until we have a proper fix.

Ideally, I want to convert all console.debug calls to just console.log. There are a lot to trim though, around 500. Also need to ask developers to not use console.debug anymore.

comment:2 Changed 13 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [16566]) Change console.debug call to console.error, refs #2924, fixes #8583. (Do we really need a console message here at all if the error can be detected programatically? Style change refs #7250

comment:3 Changed 13 years ago by Adam Peller

The model I've been promoting is that neither console.debug nor console.log belong in our code, except maybe in the case of experimental code where log might be ok. It's akin to leaving printf's in your code and implies that something is unfinished. console.error and warn are used in our code when something is important enough that the end user should see it, and even there we need to better define our style.

We had gone through and removed them all, I think, but it seems they're creeping back into the codebase. Most of the hits you see are commented out. This was the last one in _base, and there are only a handful in core and dijit. Ripping out console.log and debug calls SRTL is a good idea IMO, with or without the build tool trick.

comment:4 Changed 13 years ago by James Burke

(In [16633]) Getting rid of console.debug calls even in comments/doc comments for code in Core, in an effort to move away from console.debug, since it is not supported in other native consoles like webkit and IE8. Refs #8583 \!strict

comment:5 Changed 13 years ago by James Burke

Milestone: tbd1.3
Note: See TracTickets for help on using tickets.