This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
'use strict'; |
|
var addToUnscopables = require('./$.add-to-unscopables') |
|
, step = require('./$.iter-step') |
|
, Iterators = require('./$.iterators') |
|
, toIObject = require('./$.to-iobject'); |
|
|
|
// 22.1.3.4 Array.prototype.entries() |
|
// 22.1.3.13 Array.prototype.keys() |
|
// 22.1.3.29 Array.prototype.values() |
|
// 22.1.3.30 Array.prototype[@@iterator]() |
|
module.exports = require('./$.iter-define')(Array, 'Array', function(iterated, kind){ |
|
this._t = toIObject(iterated); // target |
|
this._i = 0; // next index |
|
this._k = kind; // kind |
|
// 22.1.5.2.1 %ArrayIteratorPrototype%.next() |
|
}, function(){ |
|
var O = this._t |
|
, kind = this._k |
|
, index = this._i++; |
|
if(!O || index >= O.length){ |
|
this._t = undefined; |
|
return step(1); |
|
} |
|
if(kind == 'keys' )return step(0, index); |
|
if(kind == 'values')return step(0, O[index]); |
|
return step(0, [index, O[index]]); |
|
}, 'values'); |
|
|
|
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) |
|
Iterators.Arguments = Iterators.Array; |
|
|
|
addToUnscopables('keys'); |
|
addToUnscopables('values'); |
|
addToUnscopables('entries'); |