code: function(t, opt) {
  
              var segments = this.segments;
              var numSegments = segments.length;
              if (numSegments === 0) return 0; // if segments is an empty array
  
              var segmentIndex = t.segmentIndex;
              if (segmentIndex < 0) return 0; // regardless of t.value
  
              var tValue = t.value;
              if (segmentIndex >= numSegments) {
                  segmentIndex = numSegments - 1;
                  tValue = 1;
              }
              else if (tValue < 0) tValue = 0;
              else if (tValue > 1) tValue = 1;
  
              opt = opt || {};
              var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision;
              var segmentSubdivisions = (opt.segmentSubdivisions === undefined) ? this.getSegmentSubdivisions({ precision: precision }) : opt.segmentSubdivisions;
              // not using localOpt
  
              var subdivisions;
              var length = 0;
              for (var i = 0; i < segmentIndex; i++) {
  
                  var segment = segments[i];
                  subdivisions = segmentSubdivisions[i];
                  length += segment.length({ precisison: precision, subdivisions: subdivisions });
              }
  
              segment = segments[segmentIndex];
              subdivisions = segmentSubdivisions[segmentIndex];
              length += segment.lengthAtT(tValue, { precisison: precision, subdivisions: subdivisions });
  
              return length;
          }
docs: Private function.