View Full Version : Defensive Programming?

3 Sep 2010, 7:03 AM
Hi ExtJS Team,

During development over the last few months using ExtJS, every now and then I would hit a random javascript error within the ext-all-debug.js code base etc.

Usually this was the result of say, calling an action method on a component that had not even rendered yet.

I was thinking instead of the script/method call just failing mid way through the ExtJS call stack with 'e is null' etc which is a bit cryptic, instead checks could be made on the state of variables (eg check e != null) and if the assertion fails throw a descriptive error such as 'Component has not rendered yet' (for eg).

It may also help new people to ExtJS to track down problems with their applications.


Jamie Avins
3 Sep 2010, 8:12 AM
For Ext 4.x we are going to try to include these types of message in the debug build which can warn of common problems and use of deprecated methods.