SVG numberOfItems属性不起作用

Jua*_*tta 5 javascript svg google-chrome

在最新更新后,我们的网站突然停止使用Chrome(只是chrome)...

给出的错误是

Uncaught TypeError: Cannot read property 'numberOfItems' of undefined
Run Code Online (Sandbox Code Playgroud)

这是使用numberOfItems属性的地方:

// Absolutize and parse path to array
  , parse: function(array) {
      /* if it's already is a patharray, no need to parse it */
      if (array instanceof SVG.PathArray) return array.valueOf()

      /* prepare for parsing */
      var i, il, x0, y0, x1, y1, x2, y2, s, seg, segs
        , x = 0
        , y = 0

      /* populate working path */
      SVG.parser.path.setAttribute('d', typeof array === 'string' ? array : arrayToString(array))

      /* get segments */
      segs = SVG.parser.path.pathSegList


      for (i = 0, il = segs.numberOfItems; i < il; ++i) {
        seg = segs.getItem(i)
        s = seg.pathSegTypeAsLetter
etc. (I didn't put the whole loop)
Run Code Online (Sandbox Code Playgroud)

为什么SVG和Javascript在最新的Chrome更新后无法读取此属性?什么是一个很好的解决方案?

谢谢!!