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() {
function getCurrentPath(compoundPath) {
if (compoundPath.children.length) {
return compoundPath.children[compoundPath.children.length - 1];
function getCurrentPath(that) {
if (that.children.length) {
return that.children[that.children.length - 1];
} else {
throw Error('Use a moveTo() command first');
}
}
var fields = {
moveBy: function() {
var point = arguments.length ? Point.read(arguments) : new Point();
var path = getCurrentPath(this);