blob: 6062d6f6f5acfe67de8d451876b35ec434306d7f [file] [log] [blame]
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var simpleIterator = function(args) {
var iter = (function(args) {
var j = 0;
var length = args.length;
return function Iterator() {
return {next: function() {
if (j < length)
{
return { value: args[j++], done: false };
}
else
{
j = 0;
return { done: true };
}
}}}})(args)
return iter;};
var a = [1,2,3];
a[Symbol.iterator] = simpleIterator(a);