@@ -67,6 +67,10 @@ def any?(&block)
67
67
}
68
68
end
69
69
70
+ def chunk ( state = undefined , &block )
71
+ raise NotImplementedError
72
+ end
73
+
70
74
def collect ( &block )
71
75
return enum_for :collect unless block_given?
72
76
@@ -90,6 +94,10 @@ def collect(&block)
90
94
}
91
95
end
92
96
97
+ def collect_concat ( &block )
98
+ raise NotImplementedError
99
+ end
100
+
93
101
def count ( object = undefined , &block )
94
102
%x{
95
103
var result = 0;
@@ -282,6 +290,14 @@ def drop_while(&block)
282
290
}
283
291
end
284
292
293
+ def each_cons ( n , &block )
294
+ raise NotImplementedError
295
+ end
296
+
297
+ def each_entry ( &block )
298
+ raise NotImplementedError
299
+ end
300
+
285
301
def each_slice ( n , &block )
286
302
n = Opal . coerce_to n , Integer , :to_int
287
303
@@ -511,6 +527,8 @@ def first(number = undefined)
511
527
result
512
528
end
513
529
530
+ alias flat_map collect_concat
531
+
514
532
def grep ( pattern , &block )
515
533
%x{
516
534
var result = [];
@@ -658,7 +676,6 @@ def lazy
658
676
def enumerator_size
659
677
respond_to? ( :size ) ? size : nil
660
678
end
661
-
662
679
private :enumerator_size
663
680
664
681
alias map collect
@@ -833,6 +850,14 @@ def min_by(&block)
833
850
}
834
851
end
835
852
853
+ def minmax ( &block )
854
+ raise NotImplementedError
855
+ end
856
+
857
+ def minmax_by ( &block )
858
+ raise NotImplementedError
859
+ end
860
+
836
861
def none? ( &block )
837
862
%x{
838
863
var result = true;
@@ -913,6 +938,18 @@ def one?(&block)
913
938
}
914
939
end
915
940
941
+ def partition ( &block )
942
+ raise NotImplementedError
943
+ end
944
+
945
+ alias reduce inject
946
+
947
+ def reverse_each ( &block )
948
+ raise NotImplementedError
949
+ end
950
+
951
+ alias select find_all
952
+
916
953
def slice_before ( pattern = undefined , &block )
917
954
if `pattern === undefined && block === nil || arguments.length > 1`
918
955
raise ArgumentError , "wrong number of arguments (#{ `arguments.length` } for 1)"
@@ -973,6 +1010,10 @@ def slice_before(pattern = undefined, &block)
973
1010
}
974
1011
end
975
1012
1013
+ def sort ( &block )
1014
+ raise NotImplementedError
1015
+ end
1016
+
976
1017
def sort_by ( &block )
977
1018
return enum_for :sort_by unless block_given?
978
1019
@@ -983,10 +1024,6 @@ def sort_by(&block)
983
1024
} . sort { |a , b | a [ 0 ] <=> b [ 0 ] } . map { |arg | `arg[1]` }
984
1025
end
985
1026
986
- alias select find_all
987
-
988
- alias reduce inject
989
-
990
1027
def take ( num )
991
1028
first ( num )
992
1029
end
@@ -1020,5 +1057,9 @@ def take_while(&block)
1020
1057
end
1021
1058
1022
1059
alias to_a entries
1060
+
1061
+ def zip ( *lists , &block )
1062
+ raise NotImplementedError
1063
+ end
1023
1064
end
1024
1065
0 commit comments