From c6d606db0aa59cbe493c177319b8d9f0f13f666e Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 27 Feb 2011 15:50:41 +0100 Subject: [PATCH] Path: After calling Path#add(segment), return the added segment. Add todo to Path#insert. --- src/path/Path.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/path/Path.js b/src/path/Path.js index fcfb06a8..52ca16a8 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -200,8 +200,11 @@ Path = PathItem.extend({ var segment = Segment.read(arguments); if (segment) this.addSegment(segment); + return segment; }, + // TODO: make sure that if the segment belongs to another path, it clones + // the segment. Otherwise it returns the same segment. insert: function(index, segment) { this._segments.splice(index, 0, new Segment(segment)); },