From 632edfdab63388c52f3593ea0516e9711f7d13b5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 25 Jun 2022 11:37:26 +0300 Subject: [PATCH] notes... Signed-off-by: Alex A. Naanou --- Array.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Array.js b/Array.js index 647e12d..63e29fb 100644 --- a/Array.js +++ b/Array.js @@ -489,11 +489,13 @@ object.Mixin('ArrayProtoMixin', 'soft', { // -> iterator // // XXX should this take an argument and be like map?? + // XXX this should handle throwing STOP!!! iter: function*(handler=undefined){ if(handler){ var i = 0 for(var e of this){ var res = handler.call(this, e, i++) + // treat non-iterables as single elements... if(typeof(res) == 'object' && Symbol.iterator in res){ yield* res