Add Symbol.iterator method to List and Results

Resolves #235
This commit is contained in:
Scott Kyle 2016-03-02 23:00:53 -08:00
parent 1cba02c34d
commit 37b2c35169
2 changed files with 10 additions and 0 deletions

View File

@ -70,3 +70,8 @@ var arrayPrototype = Array.prototype;
exports[methodName] = {value: method};
});
/* global Symbol */
if (typeof Symbol != 'undefined' && Symbol.iterator) {
exports[Symbol.iterator] = exports.values;
}

View File

@ -571,7 +571,12 @@ module.exports = BaseTest.extend({
'entries',
'keys',
'values',
typeof Symbol != 'undefined' && Symbol.iterator, // eslint-disable-line no-undef
].forEach(function(methodName) {
if (!methodName) {
return;
}
var iterator = list[methodName]();
var count = 0;
var result;