properly support iterators in sliced-to-array helper...

This commit is contained in:
Sebastian McKenzie
2015-03-19 01:47:19 +11:00
parent c3bdecbd25
commit fdea18a289
10 changed files with 43 additions and 31 deletions

View File

@@ -1,10 +1,8 @@
"use strict";
var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
var _ref = f();
var _ref2 = _slicedToArray(_ref, 2);
var _ref2 = babelHelpers.slicedToArray(_ref, 2);
a = _ref2[0];
b = _ref2[1];