diff --git a/lib/array-methods.js b/lib/array-methods.js index 0bd31e71..ea279122 100644 --- a/lib/array-methods.js +++ b/lib/array-methods.js @@ -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; +} diff --git a/tests/js/list-tests.js b/tests/js/list-tests.js index 9e95121d..34d79028 100644 --- a/tests/js/list-tests.js +++ b/tests/js/list-tests.js @@ -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;