ExtJS.Bugs: Difference between revisions

From John's wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 28: Line 28:


Example code, lines 10 to 23, seems like a bad idea. Using a static fly-weight object from a background "thread". This only works because the scripting environment isn't actually multi-threaded.
Example code, lines 10 to 23, seems like a bad idea. Using a static fly-weight object from a background "thread". This only works because the scripting environment isn't actually multi-threaded.
var task = {
  run: function(){
    Ext.fly('clock').update(new Date().format('g:i:s A'));
  },
  interval: 1000 //1 second
}

Revision as of 16:50, 10 June 2008

ext-2.0.2\source\util\MixedCollection.js:83-84

var old = this.map[key];
if ( old ) {

Will fail if false boolean values (or other falsey values) are stored in the collection.

Suggested fix:

var old = this.map[key];
if ( typeof old !== "undefined" ) {

ext-2.0.2\source\util\MixedCollection.js:391

c[c.length] = {key: k[i], value: items[i], index: i};

Two scripted operations instead of one. Why?

Suggested fix:

c.push( {key: k[i], value: items[i], index: i} );

ext-2.0.2\source\util\MixedCollection.js

Why aren't the "private" functions '_sort' and 'createValueMatcher' stored in a closure? Rather they are exposed as part of the public interface.

ext-2.1\source\util\TaskMgr.js

Example code, lines 10 to 23, seems like a bad idea. Using a static fly-weight object from a background "thread". This only works because the scripting environment isn't actually multi-threaded.

var task = {
  run: function(){
    Ext.fly('clock').update(new Date().format('g:i:s A'));
  },
  interval: 1000 //1 second
}