mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Assume that _index is always correct and do not check for Base.splice() result in remove functions.
This commit is contained in:
parent
57e23950c2
commit
2fe274741a
2 changed files with 9 additions and 6 deletions
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue