mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 18:14:12 +01:00
Make step a default parameter of util.range.
This commit is contained in:
@@ -1203,13 +1203,11 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
*
|
*
|
||||||
* @param {number} start The interval's start value.
|
* @param {number} start The interval's start value.
|
||||||
* @param {number} end The interval's end value.
|
* @param {number} end The interval's end value.
|
||||||
* @param {boolean} step The value to step the range by. May be
|
* @param {number} step The value to step the range by. May be negative.
|
||||||
* negative. @default 1
|
* @default 1
|
||||||
* @returns {Iterator(Object)}
|
* @returns {Generator(number)}
|
||||||
*/
|
*/
|
||||||
range: function* range(start, end, step) {
|
range: function* range(start, end, step=1) {
|
||||||
if (!step)
|
|
||||||
step = 1;
|
|
||||||
if (step > 0) {
|
if (step > 0) {
|
||||||
for (; start < end; start += step)
|
for (; start < end; start += step)
|
||||||
yield start;
|
yield start;
|
||||||
|
|||||||
Reference in New Issue
Block a user