From 3ac9a4f369e5e54932ec916f5bb70147e3031ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 15 Aug 2014 15:38:28 +0200 Subject: [PATCH] Use local parent short-cut variable. --- src/item/Item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index a2523b03..0ac41aa4 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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