From b8530935a79c3313ab0988d32a7337c54c94a4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 27 Sep 2014 22:03:20 +0200 Subject: [PATCH] Streamline CurveLocation#getTangent/Normal/Curvature getter definitions to align with definitions in Curve, Path and PathIterator. --- src/path/CurveLocation.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 22142903..1818b5b8 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -286,14 +286,12 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ parts.push('distance: ' + f.number(this._distance)); return '{ ' + parts.join(', ') + ' }'; } -}, Base.each(['Tangent', 'Normal', 'Curvature'], +}, Base.each(['getTangent', 'getNormal', 'getCurvature'], function(name) { // Produce getters for #getTangent() / #getNormal() / #getCurvature() - function(name) { - var get = 'get' + name + 'At'; - this['get' + name] = function() { - var parameter = this.getParameter(), - curve = this.getCurve(); - return parameter != null && curve && curve[get](parameter, true); - }; - }, {} -)); + var get = name + 'At'; + this[name] = function() { + var parameter = this.getParameter(), + curve = this.getCurve(); + return parameter != null && curve && curve[get](parameter, true); + }; +}, {}));