Assume that _index is always correct and do not check for Base.splice() result in remove functions.

This commit is contained in:
Jürg Lehni 2011-06-19 16:08:51 +01:00
parent 57e23950c2
commit 2fe274741a
2 changed files with 9 additions and 6 deletions

View file

@ -777,9 +777,9 @@ var Item = this.Item = Base.extend({
if (this._parent) {
if (this._name)
this._removeFromNamed();
var res = Base.splice(this._parent._children, null, this._index, 1);
Base.splice(this._parent._children, null, this._index, 1);
this._parent = null;
return !!res.length;
return true;
}
return false;
},

View file

@ -97,7 +97,7 @@ var Project = this.Project = Base.extend({
* in it.
*/
activate: function() {
if (this._index != null) {
if (this._scope) {
this._scope.project = this;
return true;
}
@ -105,9 +105,12 @@ var Project = this.Project = Base.extend({
},
remove: function() {
var res = Base.splice(this._scope.projects, null, this._index, 1);
this._scope = null;
return !!res.length;
if (this._scope) {
Base.splice(this._scope.projects, null, this._index, 1);
this._scope = null;
return true;
}
return false;
},
/**