Use local parent short-cut variable.

This commit is contained in:
Jürg Lehni 2014-08-15 15:38:28 +02:00
parent 4d4a39c752
commit 3ac9a4f369

View file

@ -368,9 +368,10 @@ var Item = Base.extend(Callback, /** @lends Item# */{
if (name === (+name) + '')
throw new Error(
'Names consisting only of numbers are not supported.');
if (name && this._parent) {
var children = this._parent._children,
namedChildren = this._parent._namedChildren,
var parent = this._parent;
if (name && parent) {
var children = parent._children,
namedChildren = parent._namedChildren,
orig = name,
i = 1;
// If unique is true, make sure we're not overriding other names