Use 'that' variable for private instance method.

This commit is contained in:
Jürg Lehni 2011-03-03 12:25:41 +00:00
parent 26ebe2f2c0
commit 1d37c7b76f

View file

@ -77,16 +77,15 @@ CompoundPath = PathItem.extend({
} }
}, new function() { }, new function() {
function getCurrentPath(compoundPath) { function getCurrentPath(that) {
if (compoundPath.children.length) { if (that.children.length) {
return compoundPath.children[compoundPath.children.length - 1]; return that.children[that.children.length - 1];
} else { } else {
throw Error('Use a moveTo() command first'); throw Error('Use a moveTo() command first');
} }
} }
var fields = { var fields = {
moveBy: function() { moveBy: function() {
var point = arguments.length ? Point.read(arguments) : new Point(); var point = arguments.length ? Point.read(arguments) : new Point();
var path = getCurrentPath(this); var path = getCurrentPath(this);