From 18383875eb9121862572ece7b19e8eb9696e6a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 11 Jun 2013 17:46:50 -0700 Subject: [PATCH] Fix global variable leakage. --- examples/Scripts/BooleanOperations.html | 6 +++--- src/path/Path.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Scripts/BooleanOperations.html b/examples/Scripts/BooleanOperations.html index 541f02f2..83db231f 100644 --- a/examples/Scripts/BooleanOperations.html +++ b/examples/Scripts/BooleanOperations.html @@ -352,7 +352,7 @@ if (! path instanceof CompoundPath || ! path instanceof Group) { return; } var center = path.bounds.center; var children = path.children, i ,len; - for (i = 0, len = children.length; i < len; i++) { + for (var i = 0, len = children.length; i < len; i++) { var cCenter = children[i].bounds.center; var vec = cCenter.subtract(center); vec = (vec.isClose([0,0], 0.5))? vec : vec.normalize(distance); @@ -386,11 +386,11 @@ function annotatePath(path, t, c, tc, remove) { if (!path) return; var crvs = path.curves; - for (i = crvs.length - 1; i >= 0; i--) { + for (var i = crvs.length - 1; i >= 0; i--) { annotateCurve(crvs[i], t, c, tc, remove); } var segs = path.segments; - for (i = segs.length - 1; i >= 0; i--) { + for (var i = segs.length - 1; i >= 0; i--) { annotateSegment(segs[i], t, c, tc, remove, true); } } diff --git a/src/path/Path.js b/src/path/Path.js index b2c0726f..74fc114f 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -234,7 +234,7 @@ var Path = PathItem.extend(/** @lends Path# */{ if (segments.length === 0) return ''; parts.push('M' + f.point(segments[0]._point)); - for (i = 0, l = segments.length - 1; i < l; i++) + for (var i = 0, l = segments.length - 1; i < l; i++) addCurve(segments[i], segments[i + 1], false); if (this._closed) { addCurve(segments[segments.length - 1], segments[0], true);