opal-rails 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/assets/javascripts/opal-jquery.js +17 -74
- data/lib/assets/javascripts/opal-spec.js +48 -133
- data/lib/assets/javascripts/opal.js +577 -805
- data/lib/opal/rails/version.rb +2 -2
- data/spec/integration/assigns_spec.rb +3 -0
- data/test_app/app/views/application/with_assignments.js.opal +0 -23
- metadata +5 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
// Opal v0.3.
|
1
|
+
// Opal v0.3.29
|
2
2
|
// http://opal.github.com
|
3
3
|
// Copyright 2012, Adam Beynon
|
4
4
|
// Released under the MIT License
|
@@ -94,7 +94,6 @@ Opal.module = function(base, id, constructor) {
|
|
94
94
|
klass = boot_class(Class, constructor);
|
95
95
|
klass._name = (base === Object ? id : base._name + '::' + id);
|
96
96
|
|
97
|
-
klass._isModule = true;
|
98
97
|
klass.$included_in = [];
|
99
98
|
|
100
99
|
var const_alloc = function() {};
|
@@ -305,9 +304,9 @@ Opal.nil = new NilClass;
|
|
305
304
|
Opal.nil.call = Opal.nil.apply = no_block_given;
|
306
305
|
|
307
306
|
Opal.breaker = new Error('unexpected break');
|
308
|
-
Opal.version = "0.3.
|
307
|
+
Opal.version = "0.3.29";
|
309
308
|
(function() {
|
310
|
-
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, def = self._klass.prototype, __breaker = __opal.breaker, __slice = __opal.slice, __gvars = __opal.gvars
|
309
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, def = self._klass.prototype, __breaker = __opal.breaker, __slice = __opal.slice, __gvars = __opal.gvars;
|
311
310
|
|
312
311
|
__gvars["~"] = nil;
|
313
312
|
__gvars["/"] = "\n";
|
@@ -319,17 +318,20 @@ Opal.version = "0.3.27";
|
|
319
318
|
|
320
319
|
return "main";
|
321
320
|
};
|
322
|
-
self.$include = function(mod) {
|
321
|
+
return self.$include = function(mod) {
|
323
322
|
|
324
323
|
return __scope.Object.$include(mod);
|
325
324
|
};
|
326
|
-
|
327
|
-
|
325
|
+
})();
|
326
|
+
(function() {
|
327
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
328
|
+
|
329
|
+
return (function(__base, __super){
|
328
330
|
function Class() {};
|
329
331
|
Class = __klass(__base, __super, "Class", Class);
|
330
|
-
var Class_prototype = Class.prototype, __scope = Class._scope, TMP_1, TMP_2, TMP_3, TMP_4;
|
331
332
|
|
332
|
-
|
333
|
+
;Class._sdonate(["$new"]); var Class_prototype = Class.prototype, __scope = Class._scope, TMP_1, TMP_2, TMP_3, TMP_4;
|
334
|
+
|
333
335
|
Class.$new = TMP_1 = function(sup) {
|
334
336
|
var __context, block;
|
335
337
|
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
@@ -351,7 +353,6 @@ Opal.version = "0.3.27";
|
|
351
353
|
|
352
354
|
};
|
353
355
|
|
354
|
-
// line 36, (corelib), Class#allocate
|
355
356
|
Class_prototype.$allocate = function() {
|
356
357
|
|
357
358
|
|
@@ -361,14 +362,12 @@ Opal.version = "0.3.27";
|
|
361
362
|
|
362
363
|
};
|
363
364
|
|
364
|
-
// line 44, (corelib), Class#alias_method
|
365
365
|
Class_prototype.$alias_method = function(newname, oldname) {
|
366
366
|
|
367
367
|
this.prototype['$' + newname] = this.prototype['$' + oldname];
|
368
368
|
return this;
|
369
369
|
};
|
370
370
|
|
371
|
-
// line 49, (corelib), Class#ancestors
|
372
371
|
Class_prototype.$ancestors = function() {
|
373
372
|
|
374
373
|
|
@@ -384,7 +383,6 @@ Opal.version = "0.3.27";
|
|
384
383
|
|
385
384
|
};
|
386
385
|
|
387
|
-
// line 63, (corelib), Class#append_features
|
388
386
|
Class_prototype.$append_features = function(klass) {
|
389
387
|
|
390
388
|
|
@@ -417,6 +415,10 @@ Opal.version = "0.3.27";
|
|
417
415
|
prototype[method] = donator[method];
|
418
416
|
}
|
419
417
|
|
418
|
+
if (prototype._smethods) {
|
419
|
+
prototype._sdonate(methods);
|
420
|
+
}
|
421
|
+
|
420
422
|
if (klass.$included_in) {
|
421
423
|
klass._donate(methods.slice(), true);
|
422
424
|
}
|
@@ -424,7 +426,6 @@ Opal.version = "0.3.27";
|
|
424
426
|
return this;
|
425
427
|
};
|
426
428
|
|
427
|
-
// line 103, (corelib), Class#attr_accessor
|
428
429
|
Class_prototype.$attr_accessor = function() {
|
429
430
|
|
430
431
|
return nil;
|
@@ -436,7 +437,6 @@ Opal.version = "0.3.27";
|
|
436
437
|
|
437
438
|
Class_prototype.$attr = Class_prototype.$attr_accessor;
|
438
439
|
|
439
|
-
// line 109, (corelib), Class#define_method
|
440
440
|
Class_prototype.$define_method = TMP_2 = function(name) {
|
441
441
|
var __context, block;
|
442
442
|
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
@@ -457,7 +457,6 @@ Opal.version = "0.3.27";
|
|
457
457
|
|
458
458
|
};
|
459
459
|
|
460
|
-
// line 126, (corelib), Class#include
|
461
460
|
Class_prototype.$include = function(mods) {
|
462
461
|
mods = __slice.call(arguments, 0);
|
463
462
|
|
@@ -478,7 +477,6 @@ Opal.version = "0.3.27";
|
|
478
477
|
|
479
478
|
};
|
480
479
|
|
481
|
-
// line 145, (corelib), Class#instance_methods
|
482
480
|
Class_prototype.$instance_methods = function(include_super) {
|
483
481
|
if (include_super == null) {
|
484
482
|
include_super = false
|
@@ -500,19 +498,16 @@ Opal.version = "0.3.27";
|
|
500
498
|
|
501
499
|
};
|
502
500
|
|
503
|
-
// line 163, (corelib), Class#included
|
504
501
|
Class_prototype.$included = function(mod) {
|
505
502
|
|
506
503
|
return nil;
|
507
504
|
};
|
508
505
|
|
509
|
-
// line 166, (corelib), Class#inherited
|
510
506
|
Class_prototype.$inherited = function(cls) {
|
511
507
|
|
512
508
|
return nil;
|
513
509
|
};
|
514
510
|
|
515
|
-
// line 169, (corelib), Class#module_eval
|
516
511
|
Class_prototype.$module_eval = TMP_3 = function() {
|
517
512
|
var __context, block;
|
518
513
|
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
@@ -528,13 +523,11 @@ Opal.version = "0.3.27";
|
|
528
523
|
|
529
524
|
Class_prototype.$class_eval = Class_prototype.$module_eval;
|
530
525
|
|
531
|
-
// line 181, (corelib), Class#name
|
532
526
|
Class_prototype.$name = function() {
|
533
527
|
|
534
528
|
return this._name;
|
535
529
|
};
|
536
530
|
|
537
|
-
// line 185, (corelib), Class#new
|
538
531
|
Class_prototype.$new = TMP_4 = function(args) {
|
539
532
|
var __context, block;
|
540
533
|
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
@@ -549,7 +542,6 @@ Opal.version = "0.3.27";
|
|
549
542
|
|
550
543
|
};
|
551
544
|
|
552
|
-
// line 196, (corelib), Class#public
|
553
545
|
Class_prototype.$public = function() {
|
554
546
|
|
555
547
|
return nil;
|
@@ -559,43 +551,62 @@ Opal.version = "0.3.27";
|
|
559
551
|
|
560
552
|
Class_prototype.$protected = Class_prototype.$public;
|
561
553
|
|
562
|
-
// line 202, (corelib), Class#superclass
|
563
554
|
Class_prototype.$superclass = function() {
|
564
555
|
|
565
556
|
|
566
557
|
return this._super || nil;
|
567
558
|
|
568
559
|
};
|
569
|
-
|
570
|
-
|
571
|
-
(
|
572
|
-
|
560
|
+
|
561
|
+
return nil;
|
562
|
+
})(self, null)
|
563
|
+
})();
|
564
|
+
(function() {
|
565
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
566
|
+
|
567
|
+
return (function(__base){
|
573
568
|
function Kernel() {};
|
574
569
|
Kernel = __module(__base, "Kernel", Kernel);
|
575
|
-
var Kernel_prototype = Kernel.prototype, __scope = Kernel._scope,
|
570
|
+
var Kernel_prototype = Kernel.prototype, __scope = Kernel._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8;
|
576
571
|
|
577
|
-
// line 209, (corelib), Kernel#=~
|
578
572
|
Kernel_prototype['$=~'] = function(obj) {
|
579
573
|
|
580
574
|
return false;
|
581
575
|
};
|
582
576
|
|
583
|
-
// line 213, (corelib), Kernel#==
|
584
577
|
Kernel_prototype['$=='] = function(other) {
|
585
578
|
|
586
579
|
return this === other;
|
587
580
|
};
|
588
581
|
|
589
|
-
// line 217, (corelib), Kernel#===
|
590
582
|
Kernel_prototype['$==='] = function(other) {
|
591
583
|
|
592
584
|
return this == other;
|
593
585
|
};
|
594
586
|
|
595
|
-
|
596
|
-
|
587
|
+
Kernel_prototype.$methods = function(all) {
|
588
|
+
if (all == null) {
|
589
|
+
all = true
|
590
|
+
}
|
591
|
+
|
592
|
+
var methods = [];
|
593
|
+
for(var k in this) {
|
594
|
+
if(k[0] == "$" && typeof (this)[k] === "function") {
|
595
|
+
if(all === false || all === nil) {
|
596
|
+
if(!Object.hasOwnProperty.call(this, k)) {
|
597
|
+
continue;
|
598
|
+
}
|
599
|
+
}
|
600
|
+
methods.push(k.substr(1));
|
601
|
+
}
|
602
|
+
}
|
603
|
+
return methods;
|
604
|
+
|
605
|
+
};
|
606
|
+
|
607
|
+
Kernel_prototype.$__send__ = TMP_1 = function(symbol, args) {
|
597
608
|
var __context, block;
|
598
|
-
block =
|
609
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
599
610
|
args = __slice.call(arguments, 1);
|
600
611
|
|
601
612
|
return this['$' + symbol].apply(this, args);
|
@@ -604,7 +615,6 @@ Opal.version = "0.3.27";
|
|
604
615
|
|
605
616
|
Kernel_prototype['$eql?'] = Kernel_prototype['$=='];
|
606
617
|
|
607
|
-
// line 229, (corelib), Kernel#Array
|
608
618
|
Kernel_prototype.$Array = function(object) {
|
609
619
|
|
610
620
|
|
@@ -619,46 +629,14 @@ Opal.version = "0.3.27";
|
|
619
629
|
|
620
630
|
};
|
621
631
|
|
622
|
-
// line 242, (corelib), Kernel#attribute_get
|
623
|
-
Kernel_prototype.$attribute_get = function(name) {
|
624
|
-
|
625
|
-
|
626
|
-
var meth = '$' + name;
|
627
|
-
if (this[meth]) {
|
628
|
-
return this[meth]();
|
629
|
-
}
|
630
|
-
|
631
|
-
meth += '?';
|
632
|
-
if (this[meth]) {
|
633
|
-
return this[meth]()
|
634
|
-
}
|
635
|
-
|
636
|
-
return nil;
|
637
|
-
|
638
|
-
};
|
639
|
-
|
640
|
-
// line 258, (corelib), Kernel#attribute_set
|
641
|
-
Kernel_prototype.$attribute_set = function(name, value) {
|
642
|
-
|
643
|
-
|
644
|
-
if (this['$' + name + '=']) {
|
645
|
-
return this['$' + name + '='](value);
|
646
|
-
}
|
647
|
-
|
648
|
-
return nil;
|
649
|
-
|
650
|
-
};
|
651
|
-
|
652
|
-
// line 268, (corelib), Kernel#class
|
653
632
|
Kernel_prototype.$class = function() {
|
654
633
|
|
655
634
|
return this._klass;
|
656
635
|
};
|
657
636
|
|
658
|
-
|
659
|
-
Kernel_prototype.$define_singleton_method = TMP_6 = function(name) {
|
637
|
+
Kernel_prototype.$define_singleton_method = TMP_2 = function(name) {
|
660
638
|
var __context, body;
|
661
|
-
body =
|
639
|
+
body = TMP_2._p || nil, __context = body._s, TMP_2._p = null;
|
662
640
|
|
663
641
|
|
664
642
|
if (body === nil) {
|
@@ -675,13 +653,11 @@ Opal.version = "0.3.27";
|
|
675
653
|
|
676
654
|
};
|
677
655
|
|
678
|
-
// line 288, (corelib), Kernel#equal?
|
679
656
|
Kernel_prototype['$equal?'] = function(other) {
|
680
657
|
|
681
658
|
return this === other;
|
682
659
|
};
|
683
660
|
|
684
|
-
// line 292, (corelib), Kernel#extend
|
685
661
|
Kernel_prototype.$extend = function(mods) {
|
686
662
|
mods = __slice.call(arguments, 0);
|
687
663
|
|
@@ -693,28 +669,24 @@ Opal.version = "0.3.27";
|
|
693
669
|
|
694
670
|
};
|
695
671
|
|
696
|
-
// line 302, (corelib), Kernel#hash
|
697
672
|
Kernel_prototype.$hash = function() {
|
698
673
|
|
699
674
|
return this._id;
|
700
675
|
};
|
701
676
|
|
702
|
-
// line 306, (corelib), Kernel#initialize
|
703
677
|
Kernel_prototype.$initialize = function() {
|
704
678
|
|
705
679
|
return nil;
|
706
680
|
};
|
707
681
|
|
708
|
-
// line 309, (corelib), Kernel#inspect
|
709
682
|
Kernel_prototype.$inspect = function() {
|
710
683
|
|
711
684
|
return this.$to_s();
|
712
685
|
};
|
713
686
|
|
714
|
-
|
715
|
-
Kernel_prototype.$instance_eval = TMP_7 = function(string) {
|
687
|
+
Kernel_prototype.$instance_eval = TMP_3 = function() {
|
716
688
|
var __context, block;
|
717
|
-
block =
|
689
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
718
690
|
|
719
691
|
|
720
692
|
if (block === nil) {
|
@@ -725,10 +697,9 @@ Opal.version = "0.3.27";
|
|
725
697
|
|
726
698
|
};
|
727
699
|
|
728
|
-
|
729
|
-
Kernel_prototype.$instance_exec = TMP_8 = function(args) {
|
700
|
+
Kernel_prototype.$instance_exec = TMP_4 = function(args) {
|
730
701
|
var __context, block;
|
731
|
-
block =
|
702
|
+
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
732
703
|
args = __slice.call(arguments, 0);
|
733
704
|
|
734
705
|
if (block === nil) {
|
@@ -739,19 +710,16 @@ Opal.version = "0.3.27";
|
|
739
710
|
|
740
711
|
};
|
741
712
|
|
742
|
-
// line 333, (corelib), Kernel#instance_of?
|
743
713
|
Kernel_prototype['$instance_of?'] = function(klass) {
|
744
714
|
|
745
715
|
return this._klass === klass;
|
746
716
|
};
|
747
717
|
|
748
|
-
// line 337, (corelib), Kernel#instance_variable_defined?
|
749
718
|
Kernel_prototype['$instance_variable_defined?'] = function(name) {
|
750
719
|
|
751
720
|
return __hasOwn.call(this, name.substr(1));
|
752
721
|
};
|
753
722
|
|
754
|
-
// line 341, (corelib), Kernel#instance_variable_get
|
755
723
|
Kernel_prototype.$instance_variable_get = function(name) {
|
756
724
|
|
757
725
|
|
@@ -761,13 +729,11 @@ Opal.version = "0.3.27";
|
|
761
729
|
|
762
730
|
};
|
763
731
|
|
764
|
-
// line 349, (corelib), Kernel#instance_variable_set
|
765
732
|
Kernel_prototype.$instance_variable_set = function(name, value) {
|
766
733
|
|
767
734
|
return this[name.substr(1)] = value;
|
768
735
|
};
|
769
736
|
|
770
|
-
// line 353, (corelib), Kernel#instance_variables
|
771
737
|
Kernel_prototype.$instance_variables = function() {
|
772
738
|
|
773
739
|
|
@@ -781,7 +747,6 @@ Opal.version = "0.3.27";
|
|
781
747
|
|
782
748
|
};
|
783
749
|
|
784
|
-
// line 365, (corelib), Kernel#is_a?
|
785
750
|
Kernel_prototype['$is_a?'] = function(klass) {
|
786
751
|
|
787
752
|
|
@@ -801,18 +766,16 @@ Opal.version = "0.3.27";
|
|
801
766
|
|
802
767
|
Kernel_prototype['$kind_of?'] = Kernel_prototype['$is_a?'];
|
803
768
|
|
804
|
-
|
805
|
-
Kernel_prototype.$lambda = TMP_9 = function() {
|
769
|
+
Kernel_prototype.$lambda = TMP_5 = function() {
|
806
770
|
var __context, block;
|
807
|
-
block =
|
771
|
+
block = TMP_5._p || nil, __context = block._s, TMP_5._p = null;
|
808
772
|
|
809
773
|
return block;
|
810
774
|
};
|
811
775
|
|
812
|
-
|
813
|
-
Kernel_prototype.$loop = TMP_10 = function() {
|
776
|
+
Kernel_prototype.$loop = TMP_6 = function() {
|
814
777
|
var __context, block;
|
815
|
-
block =
|
778
|
+
block = TMP_6._p || nil, __context = block._s, TMP_6._p = null;
|
816
779
|
|
817
780
|
while (true) {;
|
818
781
|
if (block.call(__context) === __breaker) return __breaker.$v;
|
@@ -820,22 +783,19 @@ Opal.version = "0.3.27";
|
|
820
783
|
return this;
|
821
784
|
};
|
822
785
|
|
823
|
-
// line 395, (corelib), Kernel#nil?
|
824
786
|
Kernel_prototype['$nil?'] = function() {
|
825
787
|
|
826
788
|
return false;
|
827
789
|
};
|
828
790
|
|
829
|
-
// line 399, (corelib), Kernel#object_id
|
830
791
|
Kernel_prototype.$object_id = function() {
|
831
792
|
|
832
793
|
return this._id || (this._id = unique_id++);
|
833
794
|
};
|
834
795
|
|
835
|
-
|
836
|
-
Kernel_prototype.$proc = TMP_11 = function() {
|
796
|
+
Kernel_prototype.$proc = TMP_7 = function() {
|
837
797
|
var __context, block;
|
838
|
-
block =
|
798
|
+
block = TMP_7._p || nil, __context = block._s, TMP_7._p = null;
|
839
799
|
|
840
800
|
|
841
801
|
if (block === nil) {
|
@@ -846,20 +806,32 @@ Opal.version = "0.3.27";
|
|
846
806
|
|
847
807
|
};
|
848
808
|
|
849
|
-
// line 413, (corelib), Kernel#puts
|
850
809
|
Kernel_prototype.$puts = function(strs) {
|
851
810
|
strs = __slice.call(arguments, 0);
|
852
811
|
|
853
812
|
for (var i = 0; i < strs.length; i++) {
|
854
|
-
|
813
|
+
if(strs[i] instanceof Array) {
|
814
|
+
this.$puts.apply(this, [].concat((strs[i])))
|
815
|
+
} else {
|
816
|
+
__opal.puts((strs[i]).$to_s());
|
817
|
+
}
|
855
818
|
}
|
856
819
|
|
857
820
|
return nil;
|
858
821
|
};
|
859
822
|
|
823
|
+
Kernel_prototype.$p = function(args) {
|
824
|
+
args = __slice.call(arguments, 0);
|
825
|
+
console.log.apply(console, args);
|
826
|
+
if (args.$length()['$<='](1)) {
|
827
|
+
return args['$[]'](0)
|
828
|
+
} else {
|
829
|
+
return args
|
830
|
+
};
|
831
|
+
};
|
832
|
+
|
860
833
|
Kernel_prototype.$print = Kernel_prototype.$puts;
|
861
834
|
|
862
|
-
// line 424, (corelib), Kernel#raise
|
863
835
|
Kernel_prototype.$raise = function(exception, string) {
|
864
836
|
|
865
837
|
|
@@ -874,13 +846,11 @@ Opal.version = "0.3.27";
|
|
874
846
|
|
875
847
|
};
|
876
848
|
|
877
|
-
// line 437, (corelib), Kernel#rand
|
878
849
|
Kernel_prototype.$rand = function(max) {
|
879
850
|
|
880
851
|
return max == null ? Math.random() : Math.floor(Math.random() * max);
|
881
852
|
};
|
882
853
|
|
883
|
-
// line 441, (corelib), Kernel#respond_to?
|
884
854
|
Kernel_prototype['$respond_to?'] = function(name) {
|
885
855
|
|
886
856
|
return !!this['$' + name];
|
@@ -888,7 +858,6 @@ Opal.version = "0.3.27";
|
|
888
858
|
|
889
859
|
Kernel_prototype.$send = Kernel_prototype.$__send__;
|
890
860
|
|
891
|
-
// line 447, (corelib), Kernel#singleton_class
|
892
861
|
Kernel_prototype.$singleton_class = function() {
|
893
862
|
|
894
863
|
|
@@ -930,89 +899,80 @@ Opal.version = "0.3.27";
|
|
930
899
|
|
931
900
|
};
|
932
901
|
|
933
|
-
|
934
|
-
Kernel_prototype.$tap = TMP_12 = function() {
|
902
|
+
Kernel_prototype.$tap = TMP_8 = function() {
|
935
903
|
var __context, block;
|
936
|
-
block =
|
904
|
+
block = TMP_8._p || nil, __context = block._s, TMP_8._p = null;
|
937
905
|
|
938
906
|
if (block.call(__context, this) === __breaker) return __breaker.$v;
|
939
907
|
return this;
|
940
908
|
};
|
941
909
|
|
942
|
-
// line 492, (corelib), Kernel#to_json
|
943
910
|
Kernel_prototype.$to_json = function() {
|
944
911
|
|
945
912
|
return this.$to_s().$to_json();
|
946
913
|
};
|
947
914
|
|
948
|
-
// line 496, (corelib), Kernel#to_proc
|
949
915
|
Kernel_prototype.$to_proc = function() {
|
950
916
|
|
951
917
|
return this;
|
952
918
|
};
|
953
919
|
|
954
|
-
// line 500, (corelib), Kernel#to_s
|
955
920
|
Kernel_prototype.$to_s = function() {
|
956
921
|
|
957
922
|
return "#<" + this._klass._name + ":" + this._id + ">";
|
958
923
|
};
|
959
|
-
;Kernel._donate(["$=~", "$==", "$===", "$
|
960
|
-
})(self)
|
961
|
-
|
962
|
-
|
924
|
+
;Kernel._donate(["$=~", "$==", "$===", "$methods", "$__send__", "$eql?", "$Array", "$class", "$define_singleton_method", "$equal?", "$extend", "$hash", "$initialize", "$inspect", "$instance_eval", "$instance_exec", "$instance_of?", "$instance_variable_defined?", "$instance_variable_get", "$instance_variable_set", "$instance_variables", "$is_a?", "$kind_of?", "$lambda", "$loop", "$nil?", "$object_id", "$proc", "$puts", "$p", "$print", "$raise", "$rand", "$respond_to?", "$send", "$singleton_class", "$tap", "$to_json", "$to_proc", "$to_s"]);
|
925
|
+
})(self)
|
926
|
+
})();
|
927
|
+
(function() {
|
928
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
929
|
+
|
930
|
+
return (function(__base, __super){
|
963
931
|
function NilClass() {};
|
964
932
|
NilClass = __klass(__base, __super, "NilClass", NilClass);
|
933
|
+
|
965
934
|
var NilClass_prototype = NilClass.prototype, __scope = NilClass._scope;
|
966
935
|
|
967
|
-
// line 505, (corelib), NilClass#&
|
968
936
|
NilClass_prototype['$&'] = function(other) {
|
969
937
|
|
970
938
|
return false;
|
971
939
|
};
|
972
940
|
|
973
|
-
// line 509, (corelib), NilClass#|
|
974
941
|
NilClass_prototype['$|'] = function(other) {
|
975
942
|
|
976
943
|
return other !== false && other !== nil;
|
977
944
|
};
|
978
945
|
|
979
|
-
// line 513, (corelib), NilClass#^
|
980
946
|
NilClass_prototype['$^'] = function(other) {
|
981
947
|
|
982
948
|
return other !== false && other !== nil;
|
983
949
|
};
|
984
950
|
|
985
|
-
// line 517, (corelib), NilClass#==
|
986
951
|
NilClass_prototype['$=='] = function(other) {
|
987
952
|
|
988
953
|
return other === nil;
|
989
954
|
};
|
990
955
|
|
991
|
-
// line 521, (corelib), NilClass#inspect
|
992
956
|
NilClass_prototype.$inspect = function() {
|
993
957
|
|
994
958
|
return "nil";
|
995
959
|
};
|
996
960
|
|
997
|
-
// line 525, (corelib), NilClass#nil?
|
998
961
|
NilClass_prototype['$nil?'] = function() {
|
999
962
|
|
1000
963
|
return true;
|
1001
964
|
};
|
1002
965
|
|
1003
|
-
// line 529, (corelib), NilClass#singleton_class
|
1004
966
|
NilClass_prototype.$singleton_class = function() {
|
1005
967
|
|
1006
968
|
return __scope.NilClass;
|
1007
969
|
};
|
1008
970
|
|
1009
|
-
// line 533, (corelib), NilClass#to_a
|
1010
971
|
NilClass_prototype.$to_a = function() {
|
1011
972
|
|
1012
973
|
return [];
|
1013
974
|
};
|
1014
975
|
|
1015
|
-
// line 537, (corelib), NilClass#to_i
|
1016
976
|
NilClass_prototype.$to_i = function() {
|
1017
977
|
|
1018
978
|
return 0;
|
@@ -1020,54 +980,52 @@ Opal.version = "0.3.27";
|
|
1020
980
|
|
1021
981
|
NilClass_prototype.$to_f = NilClass_prototype.$to_i;
|
1022
982
|
|
1023
|
-
// line 543, (corelib), NilClass#to_json
|
1024
983
|
NilClass_prototype.$to_json = function() {
|
1025
984
|
|
1026
985
|
return "null";
|
1027
986
|
};
|
1028
987
|
|
1029
|
-
// line 547, (corelib), NilClass#to_native
|
1030
988
|
NilClass_prototype.$to_native = function() {
|
1031
989
|
|
1032
990
|
return null;
|
1033
991
|
};
|
1034
992
|
|
1035
|
-
// line 551, (corelib), NilClass#to_s
|
1036
993
|
NilClass_prototype.$to_s = function() {
|
1037
994
|
|
1038
995
|
return "";
|
1039
996
|
};
|
1040
997
|
|
1041
|
-
|
1042
|
-
(
|
1043
|
-
|
998
|
+
return nil;
|
999
|
+
})(self, null)
|
1000
|
+
})();
|
1001
|
+
(function() {
|
1002
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
1003
|
+
|
1004
|
+
return (function(__base, __super){
|
1044
1005
|
function Boolean() {};
|
1045
1006
|
Boolean = __klass(__base, __super, "Boolean", Boolean);
|
1007
|
+
|
1046
1008
|
var Boolean_prototype = Boolean.prototype, __scope = Boolean._scope;
|
1047
1009
|
|
1048
1010
|
|
1049
1011
|
Boolean_prototype._isBoolean = true;
|
1050
1012
|
|
1051
1013
|
|
1052
|
-
// line 560, (corelib), Boolean#&
|
1053
1014
|
Boolean_prototype['$&'] = function(other) {
|
1054
1015
|
|
1055
1016
|
return (this == true) ? (other !== false && other !== nil) : false;
|
1056
1017
|
};
|
1057
1018
|
|
1058
|
-
// line 564, (corelib), Boolean#|
|
1059
1019
|
Boolean_prototype['$|'] = function(other) {
|
1060
1020
|
|
1061
1021
|
return (this == true) ? true : (other !== false && other !== nil);
|
1062
1022
|
};
|
1063
1023
|
|
1064
|
-
// line 568, (corelib), Boolean#^
|
1065
1024
|
Boolean_prototype['$^'] = function(other) {
|
1066
1025
|
|
1067
1026
|
return (this == true) ? (other === false || other === nil) : (other !== false && other !== nil);
|
1068
1027
|
};
|
1069
1028
|
|
1070
|
-
// line 572, (corelib), Boolean#==
|
1071
1029
|
Boolean_prototype['$=='] = function(other) {
|
1072
1030
|
|
1073
1031
|
return (this == true) === other.valueOf();
|
@@ -1075,33 +1033,34 @@ Opal.version = "0.3.27";
|
|
1075
1033
|
|
1076
1034
|
Boolean_prototype.$singleton_class = Boolean_prototype.$class;
|
1077
1035
|
|
1078
|
-
// line 578, (corelib), Boolean#to_json
|
1079
1036
|
Boolean_prototype.$to_json = function() {
|
1080
1037
|
|
1081
1038
|
return (this == true) ? 'true' : 'false';
|
1082
1039
|
};
|
1083
1040
|
|
1084
|
-
// line 582, (corelib), Boolean#to_s
|
1085
1041
|
Boolean_prototype.$to_s = function() {
|
1086
1042
|
|
1087
1043
|
return (this == true) ? 'true' : 'false';
|
1088
1044
|
};
|
1089
1045
|
|
1090
|
-
|
1046
|
+
return nil;
|
1047
|
+
})(self, Boolean)
|
1048
|
+
})();
|
1049
|
+
(function() {
|
1050
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
1051
|
+
|
1091
1052
|
(function(__base, __super){
|
1092
|
-
// line 586, (corelib), class Exception
|
1093
1053
|
function Exception() {};
|
1094
1054
|
Exception = __klass(__base, __super, "Exception", Exception);
|
1095
|
-
|
1055
|
+
|
1056
|
+
;Exception._sdonate(["$new"]); var Exception_prototype = Exception.prototype, __scope = Exception._scope;
|
1096
1057
|
Exception_prototype.message = nil;
|
1097
1058
|
|
1098
|
-
// line 587, (corelib), Exception#message
|
1099
1059
|
Exception_prototype.$message = function() {
|
1100
1060
|
|
1101
1061
|
return this.message
|
1102
|
-
};
|
1062
|
+
}, nil;
|
1103
1063
|
|
1104
|
-
// line 589, (corelib), Exception.new
|
1105
1064
|
Exception.$new = function(message) {
|
1106
1065
|
if (message == null) {
|
1107
1066
|
message = ""
|
@@ -1113,7 +1072,6 @@ Opal.version = "0.3.27";
|
|
1113
1072
|
|
1114
1073
|
};
|
1115
1074
|
|
1116
|
-
// line 597, (corelib), Exception#backtrace
|
1117
1075
|
Exception_prototype.$backtrace = function() {
|
1118
1076
|
|
1119
1077
|
|
@@ -1130,14 +1088,12 @@ Opal.version = "0.3.27";
|
|
1130
1088
|
|
1131
1089
|
};
|
1132
1090
|
|
1133
|
-
// line 612, (corelib), Exception#inspect
|
1134
1091
|
Exception_prototype.$inspect = function() {
|
1135
1092
|
|
1136
1093
|
return "#<" + (this.$class().$name()) + ": '" + (this.message) + "'>";
|
1137
1094
|
};
|
1138
1095
|
|
1139
|
-
Exception_prototype.$to_s = Exception_prototype.$message;
|
1140
|
-
;Exception._sdonate(["$new"]);
|
1096
|
+
return Exception_prototype.$to_s = Exception_prototype.$message;
|
1141
1097
|
})(self, Error);
|
1142
1098
|
__scope.StandardError = __scope.Exception;
|
1143
1099
|
__scope.RuntimeError = __scope.Exception;
|
@@ -1148,26 +1104,27 @@ Opal.version = "0.3.27";
|
|
1148
1104
|
__scope.ArgumentError = __scope.Exception;
|
1149
1105
|
__scope.IndexError = __scope.Exception;
|
1150
1106
|
__scope.KeyError = __scope.Exception;
|
1151
|
-
__scope.RangeError = __scope.Exception;
|
1107
|
+
return __scope.RangeError = __scope.Exception;
|
1108
|
+
})();
|
1109
|
+
(function() {
|
1110
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass, __gvars = __opal.gvars;
|
1111
|
+
|
1152
1112
|
(function(__base, __super){
|
1153
|
-
// line 629, (corelib), class Regexp
|
1154
1113
|
function Regexp() {};
|
1155
1114
|
Regexp = __klass(__base, __super, "Regexp", Regexp);
|
1156
|
-
var Regexp_prototype = Regexp.prototype, __scope = Regexp._scope;
|
1157
1115
|
|
1158
|
-
|
1116
|
+
;Regexp._sdonate(["$escape", "$new"]); var Regexp_prototype = Regexp.prototype, __scope = Regexp._scope;
|
1117
|
+
|
1159
1118
|
Regexp.$escape = function(string) {
|
1160
1119
|
|
1161
1120
|
return string.replace(/([.*+?^=!:${}()|[]\/\])/g, '\$1');
|
1162
1121
|
};
|
1163
1122
|
|
1164
|
-
// line 634, (corelib), Regexp.new
|
1165
1123
|
Regexp.$new = function(string, options) {
|
1166
1124
|
|
1167
1125
|
return new RegExp(string, options);
|
1168
1126
|
};
|
1169
1127
|
|
1170
|
-
// line 638, (corelib), Regexp#==
|
1171
1128
|
Regexp_prototype['$=='] = function(other) {
|
1172
1129
|
|
1173
1130
|
return other.constructor == RegExp && this.toString() === other.toString();
|
@@ -1175,7 +1132,6 @@ Opal.version = "0.3.27";
|
|
1175
1132
|
|
1176
1133
|
Regexp_prototype['$==='] = Regexp_prototype.test;
|
1177
1134
|
|
1178
|
-
// line 644, (corelib), Regexp#=~
|
1179
1135
|
Regexp_prototype['$=~'] = function(string) {
|
1180
1136
|
|
1181
1137
|
|
@@ -1200,7 +1156,6 @@ Opal.version = "0.3.27";
|
|
1200
1156
|
|
1201
1157
|
Regexp_prototype.$inspect = Regexp_prototype.toString;
|
1202
1158
|
|
1203
|
-
// line 667, (corelib), Regexp#match
|
1204
1159
|
Regexp_prototype.$match = function(pattern) {
|
1205
1160
|
|
1206
1161
|
|
@@ -1219,7 +1174,6 @@ Opal.version = "0.3.27";
|
|
1219
1174
|
|
1220
1175
|
};
|
1221
1176
|
|
1222
|
-
// line 684, (corelib), Regexp#to_s
|
1223
1177
|
Regexp_prototype.$to_s = function() {
|
1224
1178
|
|
1225
1179
|
return this.source;
|
@@ -1234,70 +1188,67 @@ Opal.version = "0.3.27";
|
|
1234
1188
|
return "<#MatchData " + this[0].$inspect() + ">";
|
1235
1189
|
}
|
1236
1190
|
|
1237
|
-
;Regexp._sdonate(["$escape", "$new"]);
|
1238
1191
|
})(self, RegExp);
|
1239
|
-
(function(__base, __super){
|
1240
|
-
// line 699, (corelib), class MatchData
|
1192
|
+
return (function(__base, __super){
|
1241
1193
|
function MatchData() {};
|
1242
1194
|
MatchData = __klass(__base, __super, "MatchData", MatchData);
|
1243
|
-
var MatchData_prototype = MatchData.prototype, __scope = MatchData._scope;
|
1244
1195
|
|
1245
|
-
|
1196
|
+
var MatchData_prototype = MatchData.prototype, __scope = MatchData._scope;
|
1246
1197
|
|
1198
|
+
return nil
|
1247
1199
|
})(self, null);
|
1248
|
-
|
1249
|
-
|
1200
|
+
})();
|
1201
|
+
(function() {
|
1202
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
1203
|
+
|
1204
|
+
return (function(__base){
|
1250
1205
|
function Comparable() {};
|
1251
1206
|
Comparable = __module(__base, "Comparable", Comparable);
|
1252
1207
|
var Comparable_prototype = Comparable.prototype, __scope = Comparable._scope;
|
1253
1208
|
|
1254
|
-
// line 702, (corelib), Comparable#<
|
1255
1209
|
Comparable_prototype['$<'] = function(other) {
|
1256
1210
|
|
1257
1211
|
return this['$<=>'](other)['$=='](-1);
|
1258
1212
|
};
|
1259
1213
|
|
1260
|
-
// line 706, (corelib), Comparable#<=
|
1261
1214
|
Comparable_prototype['$<='] = function(other) {
|
1262
1215
|
|
1263
1216
|
return this['$<=>'](other)['$<='](0);
|
1264
1217
|
};
|
1265
1218
|
|
1266
|
-
// line 710, (corelib), Comparable#==
|
1267
1219
|
Comparable_prototype['$=='] = function(other) {
|
1268
1220
|
|
1269
1221
|
return this['$<=>'](other)['$=='](0);
|
1270
1222
|
};
|
1271
1223
|
|
1272
|
-
// line 714, (corelib), Comparable#>
|
1273
1224
|
Comparable_prototype['$>'] = function(other) {
|
1274
1225
|
|
1275
1226
|
return this['$<=>'](other)['$=='](1);
|
1276
1227
|
};
|
1277
1228
|
|
1278
|
-
// line 718, (corelib), Comparable#>=
|
1279
1229
|
Comparable_prototype['$>='] = function(other) {
|
1280
1230
|
|
1281
1231
|
return this['$<=>'](other)['$>='](0);
|
1282
1232
|
};
|
1283
1233
|
|
1284
|
-
// line 722, (corelib), Comparable#between?
|
1285
1234
|
Comparable_prototype['$between?'] = function(min, max) {
|
1286
1235
|
var __a;
|
1287
1236
|
return ((__a = this['$>'](min)) ? this['$<'](max) : __a);
|
1288
1237
|
};
|
1289
1238
|
;Comparable._donate(["$<", "$<=", "$==", "$>", "$>=", "$between?"]);
|
1290
|
-
})(self)
|
1291
|
-
|
1292
|
-
|
1239
|
+
})(self)
|
1240
|
+
})();
|
1241
|
+
(function() {
|
1242
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
1243
|
+
|
1244
|
+
return (function(__base){
|
1293
1245
|
function Enumerable() {};
|
1294
1246
|
Enumerable = __module(__base, "Enumerable", Enumerable);
|
1295
|
-
var Enumerable_prototype = Enumerable.prototype, __scope = Enumerable._scope,
|
1247
|
+
var Enumerable_prototype = Enumerable.prototype, __scope = Enumerable._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12;
|
1296
1248
|
|
1297
|
-
|
1298
|
-
Enumerable_prototype['$all?'] = TMP_13 = function() {
|
1249
|
+
Enumerable_prototype['$all?'] = TMP_1 = function() {
|
1299
1250
|
var __context, block;
|
1300
|
-
block =
|
1251
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
1301
1252
|
|
1302
1253
|
|
1303
1254
|
var result = true, proc;
|
@@ -1336,10 +1287,9 @@ Opal.version = "0.3.27";
|
|
1336
1287
|
|
1337
1288
|
};
|
1338
1289
|
|
1339
|
-
|
1340
|
-
Enumerable_prototype['$any?'] = TMP_14 = function() {
|
1290
|
+
Enumerable_prototype['$any?'] = TMP_2 = function() {
|
1341
1291
|
var __context, block;
|
1342
|
-
block =
|
1292
|
+
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
1343
1293
|
|
1344
1294
|
|
1345
1295
|
var result = false, proc;
|
@@ -1378,10 +1328,9 @@ Opal.version = "0.3.27";
|
|
1378
1328
|
|
1379
1329
|
};
|
1380
1330
|
|
1381
|
-
|
1382
|
-
Enumerable_prototype.$collect = TMP_15 = function() {
|
1331
|
+
Enumerable_prototype.$collect = TMP_3 = function() {
|
1383
1332
|
var __context, block;
|
1384
|
-
block =
|
1333
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
1385
1334
|
|
1386
1335
|
|
1387
1336
|
var result = [];
|
@@ -1403,10 +1352,36 @@ Opal.version = "0.3.27";
|
|
1403
1352
|
|
1404
1353
|
};
|
1405
1354
|
|
1406
|
-
|
1407
|
-
Enumerable_prototype.$count = TMP_16 = function(object) {
|
1355
|
+
Enumerable_prototype.$reduce = TMP_4 = function(object) {
|
1408
1356
|
var __context, block;
|
1409
|
-
block =
|
1357
|
+
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
1358
|
+
|
1359
|
+
|
1360
|
+
var result = object == undefined ? 0 : object;
|
1361
|
+
|
1362
|
+
var proc = function() {
|
1363
|
+
var obj = __slice.call(arguments), value;
|
1364
|
+
|
1365
|
+
if ((value = block.apply(__context, [result].concat(obj))) === __breaker) {
|
1366
|
+
result = __breaker.$v;
|
1367
|
+
__breaker.$v = nil;
|
1368
|
+
|
1369
|
+
return __breaker;
|
1370
|
+
}
|
1371
|
+
|
1372
|
+
result = value;
|
1373
|
+
};
|
1374
|
+
|
1375
|
+
this.$each._p = proc;
|
1376
|
+
this.$each();
|
1377
|
+
|
1378
|
+
return result;
|
1379
|
+
|
1380
|
+
};
|
1381
|
+
|
1382
|
+
Enumerable_prototype.$count = TMP_5 = function(object) {
|
1383
|
+
var __context, block;
|
1384
|
+
block = TMP_5._p || nil, __context = block._s, TMP_5._p = null;
|
1410
1385
|
|
1411
1386
|
|
1412
1387
|
var result = 0;
|
@@ -1437,10 +1412,9 @@ Opal.version = "0.3.27";
|
|
1437
1412
|
|
1438
1413
|
};
|
1439
1414
|
|
1440
|
-
|
1441
|
-
Enumerable_prototype.$detect = TMP_17 = function(ifnone) {
|
1415
|
+
Enumerable_prototype.$detect = TMP_6 = function(ifnone) {
|
1442
1416
|
var __context, block;
|
1443
|
-
block =
|
1417
|
+
block = TMP_6._p || nil, __context = block._s, TMP_6._p = null;
|
1444
1418
|
|
1445
1419
|
|
1446
1420
|
var result = nil;
|
@@ -1474,7 +1448,6 @@ Opal.version = "0.3.27";
|
|
1474
1448
|
|
1475
1449
|
};
|
1476
1450
|
|
1477
|
-
// line 887, (corelib), Enumerable#drop
|
1478
1451
|
Enumerable_prototype.$drop = function(number) {
|
1479
1452
|
|
1480
1453
|
|
@@ -1495,10 +1468,9 @@ Opal.version = "0.3.27";
|
|
1495
1468
|
|
1496
1469
|
};
|
1497
1470
|
|
1498
|
-
|
1499
|
-
Enumerable_prototype.$drop_while = TMP_18 = function() {
|
1471
|
+
Enumerable_prototype.$drop_while = TMP_7 = function() {
|
1500
1472
|
var __context, block;
|
1501
|
-
block =
|
1473
|
+
block = TMP_7._p || nil, __context = block._s, TMP_7._p = null;
|
1502
1474
|
|
1503
1475
|
|
1504
1476
|
var result = [];
|
@@ -1514,8 +1486,8 @@ Opal.version = "0.3.27";
|
|
1514
1486
|
result.push(obj);
|
1515
1487
|
return value;
|
1516
1488
|
}
|
1517
|
-
|
1518
|
-
|
1489
|
+
|
1490
|
+
|
1519
1491
|
return __breaker;
|
1520
1492
|
};
|
1521
1493
|
|
@@ -1525,10 +1497,9 @@ Opal.version = "0.3.27";
|
|
1525
1497
|
|
1526
1498
|
};
|
1527
1499
|
|
1528
|
-
|
1529
|
-
Enumerable_prototype.$each_with_index = TMP_19 = function() {
|
1500
|
+
Enumerable_prototype.$each_with_index = TMP_8 = function() {
|
1530
1501
|
var __context, block;
|
1531
|
-
block =
|
1502
|
+
block = TMP_8._p || nil, __context = block._s, TMP_8._p = null;
|
1532
1503
|
|
1533
1504
|
|
1534
1505
|
var index = 0;
|
@@ -1549,10 +1520,9 @@ Opal.version = "0.3.27";
|
|
1549
1520
|
|
1550
1521
|
};
|
1551
1522
|
|
1552
|
-
|
1553
|
-
Enumerable_prototype.$each_with_object = TMP_20 = function(object) {
|
1523
|
+
Enumerable_prototype.$each_with_object = TMP_9 = function(object) {
|
1554
1524
|
var __context, block;
|
1555
|
-
block =
|
1525
|
+
block = TMP_9._p || nil, __context = block._s, TMP_9._p = null;
|
1556
1526
|
|
1557
1527
|
|
1558
1528
|
this.$each._p = function(obj) {
|
@@ -1569,7 +1539,6 @@ Opal.version = "0.3.27";
|
|
1569
1539
|
|
1570
1540
|
};
|
1571
1541
|
|
1572
|
-
// line 968, (corelib), Enumerable#entries
|
1573
1542
|
Enumerable_prototype.$entries = function() {
|
1574
1543
|
|
1575
1544
|
|
@@ -1587,10 +1556,9 @@ Opal.version = "0.3.27";
|
|
1587
1556
|
|
1588
1557
|
Enumerable_prototype.$find = Enumerable_prototype.$detect;
|
1589
1558
|
|
1590
|
-
|
1591
|
-
Enumerable_prototype.$find_all = TMP_21 = function() {
|
1559
|
+
Enumerable_prototype.$find_all = TMP_10 = function() {
|
1592
1560
|
var __context, block;
|
1593
|
-
block =
|
1561
|
+
block = TMP_10._p || nil, __context = block._s, TMP_10._p = null;
|
1594
1562
|
|
1595
1563
|
|
1596
1564
|
var result = [];
|
@@ -1613,16 +1581,15 @@ Opal.version = "0.3.27";
|
|
1613
1581
|
|
1614
1582
|
};
|
1615
1583
|
|
1616
|
-
|
1617
|
-
Enumerable_prototype.$find_index = TMP_22 = function(object) {
|
1584
|
+
Enumerable_prototype.$find_index = TMP_11 = function(object) {
|
1618
1585
|
var __context, block;
|
1619
|
-
block =
|
1586
|
+
block = TMP_11._p || nil, __context = block._s, TMP_11._p = null;
|
1620
1587
|
|
1621
1588
|
|
1622
1589
|
var proc, result = nil, index = 0;
|
1623
1590
|
|
1624
1591
|
if (object != null) {
|
1625
|
-
proc = function (obj) {
|
1592
|
+
proc = function (obj) {
|
1626
1593
|
if ((obj)['$=='](object)) {
|
1627
1594
|
result = index;
|
1628
1595
|
return __breaker;
|
@@ -1655,7 +1622,6 @@ Opal.version = "0.3.27";
|
|
1655
1622
|
|
1656
1623
|
};
|
1657
1624
|
|
1658
|
-
// line 1044, (corelib), Enumerable#first
|
1659
1625
|
Enumerable_prototype.$first = function(number) {
|
1660
1626
|
|
1661
1627
|
|
@@ -1687,10 +1653,9 @@ Opal.version = "0.3.27";
|
|
1687
1653
|
|
1688
1654
|
};
|
1689
1655
|
|
1690
|
-
|
1691
|
-
Enumerable_prototype.$grep = TMP_23 = function(pattern) {
|
1656
|
+
Enumerable_prototype.$grep = TMP_12 = function(pattern) {
|
1692
1657
|
var __context, block;
|
1693
|
-
block =
|
1658
|
+
block = TMP_12._p || nil, __context = block._s, TMP_12._p = null;
|
1694
1659
|
|
1695
1660
|
|
1696
1661
|
var result = [];
|
@@ -1721,18 +1686,26 @@ Opal.version = "0.3.27";
|
|
1721
1686
|
|
1722
1687
|
};
|
1723
1688
|
|
1689
|
+
Enumerable_prototype.$map = Enumerable_prototype.$collect;
|
1690
|
+
|
1724
1691
|
Enumerable_prototype.$select = Enumerable_prototype.$find_all;
|
1725
1692
|
|
1726
1693
|
Enumerable_prototype.$take = Enumerable_prototype.$first;
|
1727
1694
|
|
1728
1695
|
Enumerable_prototype.$to_a = Enumerable_prototype.$entries;
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1696
|
+
|
1697
|
+
Enumerable_prototype.$inject = Enumerable_prototype.$reduce;
|
1698
|
+
;Enumerable._donate(["$all?", "$any?", "$collect", "$reduce", "$count", "$detect", "$drop", "$drop_while", "$each_with_index", "$each_with_object", "$entries", "$find", "$find_all", "$find_index", "$first", "$grep", "$map", "$select", "$take", "$to_a", "$inject"]);
|
1699
|
+
})(self)
|
1700
|
+
})();
|
1701
|
+
(function() {
|
1702
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
1703
|
+
|
1704
|
+
return (function(__base, __super){
|
1733
1705
|
function Array() {};
|
1734
1706
|
Array = __klass(__base, __super, "Array", Array);
|
1735
|
-
|
1707
|
+
|
1708
|
+
;Array._sdonate(["$[]", "$new"]); var Array_prototype = Array.prototype, __scope = Array._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12, TMP_13, TMP_14, TMP_15, TMP_16, TMP_17;
|
1736
1709
|
|
1737
1710
|
|
1738
1711
|
Array_prototype._isArray = true;
|
@@ -1740,7 +1713,6 @@ Opal.version = "0.3.27";
|
|
1740
1713
|
|
1741
1714
|
Array.$include(__scope.Enumerable);
|
1742
1715
|
|
1743
|
-
// line 1117, (corelib), Array.[]
|
1744
1716
|
Array['$[]'] = function(objects) {
|
1745
1717
|
objects = __slice.call(arguments, 0);
|
1746
1718
|
|
@@ -1748,10 +1720,9 @@ Opal.version = "0.3.27";
|
|
1748
1720
|
|
1749
1721
|
};
|
1750
1722
|
|
1751
|
-
|
1752
|
-
Array.$new = TMP_24 = function(size, obj) {
|
1723
|
+
Array.$new = TMP_1 = function(size, obj) {
|
1753
1724
|
var __context, block;
|
1754
|
-
block =
|
1725
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
1755
1726
|
if (obj == null) {
|
1756
1727
|
obj = nil
|
1757
1728
|
}
|
@@ -1780,7 +1751,6 @@ Opal.version = "0.3.27";
|
|
1780
1751
|
|
1781
1752
|
};
|
1782
1753
|
|
1783
|
-
// line 1149, (corelib), Array#&
|
1784
1754
|
Array_prototype['$&'] = function(other) {
|
1785
1755
|
|
1786
1756
|
|
@@ -1807,7 +1777,6 @@ Opal.version = "0.3.27";
|
|
1807
1777
|
|
1808
1778
|
};
|
1809
1779
|
|
1810
|
-
// line 1174, (corelib), Array#*
|
1811
1780
|
Array_prototype['$*'] = function(other) {
|
1812
1781
|
|
1813
1782
|
|
@@ -1825,13 +1794,11 @@ Opal.version = "0.3.27";
|
|
1825
1794
|
|
1826
1795
|
};
|
1827
1796
|
|
1828
|
-
// line 1190, (corelib), Array#+
|
1829
1797
|
Array_prototype['$+'] = function(other) {
|
1830
1798
|
|
1831
1799
|
return this.slice().concat(other.slice());
|
1832
1800
|
};
|
1833
1801
|
|
1834
|
-
// line 1194, (corelib), Array#-
|
1835
1802
|
Array_prototype['$-'] = function(other) {
|
1836
1803
|
var __a, __b;
|
1837
1804
|
return (__b = this, __b.$reject._p = (__a = function(i) {
|
@@ -1843,14 +1810,12 @@ Opal.version = "0.3.27";
|
|
1843
1810
|
}, __a._s = this, __a), __b.$reject());
|
1844
1811
|
};
|
1845
1812
|
|
1846
|
-
// line 1198, (corelib), Array#<<
|
1847
1813
|
Array_prototype['$<<'] = function(object) {
|
1848
1814
|
|
1849
1815
|
this.push(object);
|
1850
1816
|
return this;
|
1851
1817
|
};
|
1852
1818
|
|
1853
|
-
// line 1204, (corelib), Array#<=>
|
1854
1819
|
Array_prototype['$<=>'] = function(other) {
|
1855
1820
|
|
1856
1821
|
|
@@ -1872,7 +1837,6 @@ Opal.version = "0.3.27";
|
|
1872
1837
|
|
1873
1838
|
};
|
1874
1839
|
|
1875
|
-
// line 1224, (corelib), Array#==
|
1876
1840
|
Array_prototype['$=='] = function(other) {
|
1877
1841
|
|
1878
1842
|
|
@@ -1890,7 +1854,6 @@ Opal.version = "0.3.27";
|
|
1890
1854
|
|
1891
1855
|
};
|
1892
1856
|
|
1893
|
-
// line 1240, (corelib), Array#[]
|
1894
1857
|
Array_prototype['$[]'] = function(index, length) {
|
1895
1858
|
|
1896
1859
|
|
@@ -1939,7 +1902,6 @@ Opal.version = "0.3.27";
|
|
1939
1902
|
|
1940
1903
|
};
|
1941
1904
|
|
1942
|
-
// line 1287, (corelib), Array#[]=
|
1943
1905
|
Array_prototype['$[]='] = function(index, value) {
|
1944
1906
|
|
1945
1907
|
|
@@ -1953,7 +1915,6 @@ Opal.version = "0.3.27";
|
|
1953
1915
|
|
1954
1916
|
};
|
1955
1917
|
|
1956
|
-
// line 1299, (corelib), Array#assoc
|
1957
1918
|
Array_prototype.$assoc = function(object) {
|
1958
1919
|
|
1959
1920
|
|
@@ -1967,7 +1928,6 @@ Opal.version = "0.3.27";
|
|
1967
1928
|
|
1968
1929
|
};
|
1969
1930
|
|
1970
|
-
// line 1311, (corelib), Array#at
|
1971
1931
|
Array_prototype.$at = function(index) {
|
1972
1932
|
|
1973
1933
|
|
@@ -1983,23 +1943,20 @@ Opal.version = "0.3.27";
|
|
1983
1943
|
|
1984
1944
|
};
|
1985
1945
|
|
1986
|
-
// line 1325, (corelib), Array#clear
|
1987
1946
|
Array_prototype.$clear = function() {
|
1988
1947
|
|
1989
1948
|
this.splice(0, this.length);
|
1990
1949
|
return this;
|
1991
1950
|
};
|
1992
1951
|
|
1993
|
-
// line 1331, (corelib), Array#clone
|
1994
1952
|
Array_prototype.$clone = function() {
|
1995
1953
|
|
1996
1954
|
return this.slice();
|
1997
1955
|
};
|
1998
1956
|
|
1999
|
-
|
2000
|
-
Array_prototype.$collect = TMP_25 = function() {
|
1957
|
+
Array_prototype.$collect = TMP_2 = function() {
|
2001
1958
|
var __context, block;
|
2002
|
-
block =
|
1959
|
+
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
2003
1960
|
|
2004
1961
|
|
2005
1962
|
var result = [];
|
@@ -2016,10 +1973,9 @@ Opal.version = "0.3.27";
|
|
2016
1973
|
|
2017
1974
|
};
|
2018
1975
|
|
2019
|
-
|
2020
|
-
Array_prototype['$collect!'] = TMP_26 = function() {
|
1976
|
+
Array_prototype['$collect!'] = TMP_3 = function() {
|
2021
1977
|
var __context, block;
|
2022
|
-
block =
|
1978
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
2023
1979
|
|
2024
1980
|
|
2025
1981
|
for (var i = 0, length = this.length, val; i < length; i++) {
|
@@ -2033,7 +1989,6 @@ Opal.version = "0.3.27";
|
|
2033
1989
|
return this;
|
2034
1990
|
};
|
2035
1991
|
|
2036
|
-
// line 1365, (corelib), Array#compact
|
2037
1992
|
Array_prototype.$compact = function() {
|
2038
1993
|
|
2039
1994
|
|
@@ -2049,7 +2004,6 @@ Opal.version = "0.3.27";
|
|
2049
2004
|
|
2050
2005
|
};
|
2051
2006
|
|
2052
|
-
// line 1379, (corelib), Array#compact!
|
2053
2007
|
Array_prototype['$compact!'] = function() {
|
2054
2008
|
|
2055
2009
|
|
@@ -2068,7 +2022,6 @@ Opal.version = "0.3.27";
|
|
2068
2022
|
|
2069
2023
|
};
|
2070
2024
|
|
2071
|
-
// line 1396, (corelib), Array#concat
|
2072
2025
|
Array_prototype.$concat = function(other) {
|
2073
2026
|
|
2074
2027
|
|
@@ -2079,7 +2032,6 @@ Opal.version = "0.3.27";
|
|
2079
2032
|
return this;
|
2080
2033
|
};
|
2081
2034
|
|
2082
|
-
// line 1406, (corelib), Array#count
|
2083
2035
|
Array_prototype.$count = function(object) {
|
2084
2036
|
|
2085
2037
|
|
@@ -2099,7 +2051,6 @@ Opal.version = "0.3.27";
|
|
2099
2051
|
|
2100
2052
|
};
|
2101
2053
|
|
2102
|
-
// line 1424, (corelib), Array#delete
|
2103
2054
|
Array_prototype.$delete = function(object) {
|
2104
2055
|
|
2105
2056
|
|
@@ -2118,7 +2069,6 @@ Opal.version = "0.3.27";
|
|
2118
2069
|
|
2119
2070
|
};
|
2120
2071
|
|
2121
|
-
// line 1441, (corelib), Array#delete_at
|
2122
2072
|
Array_prototype.$delete_at = function(index) {
|
2123
2073
|
|
2124
2074
|
|
@@ -2138,10 +2088,9 @@ Opal.version = "0.3.27";
|
|
2138
2088
|
|
2139
2089
|
};
|
2140
2090
|
|
2141
|
-
|
2142
|
-
Array_prototype.$delete_if = TMP_27 = function() {
|
2091
|
+
Array_prototype.$delete_if = TMP_4 = function() {
|
2143
2092
|
var __context, block;
|
2144
|
-
block =
|
2093
|
+
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
2145
2094
|
|
2146
2095
|
|
2147
2096
|
for (var i = 0, length = this.length, value; i < length; i++) {
|
@@ -2160,7 +2109,6 @@ Opal.version = "0.3.27";
|
|
2160
2109
|
return this;
|
2161
2110
|
};
|
2162
2111
|
|
2163
|
-
// line 1478, (corelib), Array#drop
|
2164
2112
|
Array_prototype.$drop = function(number) {
|
2165
2113
|
|
2166
2114
|
return this.slice(number);
|
@@ -2168,10 +2116,9 @@ Opal.version = "0.3.27";
|
|
2168
2116
|
|
2169
2117
|
Array_prototype.$dup = Array_prototype.$clone;
|
2170
2118
|
|
2171
|
-
|
2172
|
-
Array_prototype.$each = TMP_28 = function() {
|
2119
|
+
Array_prototype.$each = TMP_5 = function() {
|
2173
2120
|
var __context, block;
|
2174
|
-
block =
|
2121
|
+
block = TMP_5._p || nil, __context = block._s, TMP_5._p = null;
|
2175
2122
|
|
2176
2123
|
for (var i = 0, length = this.length; i < length; i++) {
|
2177
2124
|
if (block.call(__context, this[i]) === __breaker) return __breaker.$v;
|
@@ -2179,10 +2126,9 @@ Opal.version = "0.3.27";
|
|
2179
2126
|
return this;
|
2180
2127
|
};
|
2181
2128
|
|
2182
|
-
|
2183
|
-
Array_prototype.$each_index = TMP_29 = function() {
|
2129
|
+
Array_prototype.$each_index = TMP_6 = function() {
|
2184
2130
|
var __context, block;
|
2185
|
-
block =
|
2131
|
+
block = TMP_6._p || nil, __context = block._s, TMP_6._p = null;
|
2186
2132
|
|
2187
2133
|
for (var i = 0, length = this.length; i < length; i++) {
|
2188
2134
|
if (block.call(__context, i) === __breaker) return __breaker.$v;
|
@@ -2190,16 +2136,14 @@ Opal.version = "0.3.27";
|
|
2190
2136
|
return this;
|
2191
2137
|
};
|
2192
2138
|
|
2193
|
-
// line 1500, (corelib), Array#empty?
|
2194
2139
|
Array_prototype['$empty?'] = function() {
|
2195
2140
|
|
2196
2141
|
return !this.length;
|
2197
2142
|
};
|
2198
2143
|
|
2199
|
-
|
2200
|
-
Array_prototype.$fetch = TMP_30 = function(index, defaults) {
|
2144
|
+
Array_prototype.$fetch = TMP_7 = function(index, defaults) {
|
2201
2145
|
var __context, block;
|
2202
|
-
block =
|
2146
|
+
block = TMP_7._p || nil, __context = block._s, TMP_7._p = null;
|
2203
2147
|
|
2204
2148
|
|
2205
2149
|
var original = index;
|
@@ -2224,7 +2168,6 @@ Opal.version = "0.3.27";
|
|
2224
2168
|
|
2225
2169
|
};
|
2226
2170
|
|
2227
|
-
// line 1528, (corelib), Array#first
|
2228
2171
|
Array_prototype.$first = function(count) {
|
2229
2172
|
|
2230
2173
|
|
@@ -2236,7 +2179,6 @@ Opal.version = "0.3.27";
|
|
2236
2179
|
|
2237
2180
|
};
|
2238
2181
|
|
2239
|
-
// line 1538, (corelib), Array#flatten
|
2240
2182
|
Array_prototype.$flatten = function(level) {
|
2241
2183
|
|
2242
2184
|
|
@@ -2265,7 +2207,6 @@ Opal.version = "0.3.27";
|
|
2265
2207
|
|
2266
2208
|
};
|
2267
2209
|
|
2268
|
-
// line 1565, (corelib), Array#flatten!
|
2269
2210
|
Array_prototype['$flatten!'] = function(level) {
|
2270
2211
|
|
2271
2212
|
|
@@ -2276,13 +2217,11 @@ Opal.version = "0.3.27";
|
|
2276
2217
|
|
2277
2218
|
};
|
2278
2219
|
|
2279
|
-
// line 1574, (corelib), Array#hash
|
2280
2220
|
Array_prototype.$hash = function() {
|
2281
2221
|
|
2282
2222
|
return this._id || (this._id = unique_id++);
|
2283
2223
|
};
|
2284
2224
|
|
2285
|
-
// line 1578, (corelib), Array#include?
|
2286
2225
|
Array_prototype['$include?'] = function(member) {
|
2287
2226
|
|
2288
2227
|
|
@@ -2296,10 +2235,9 @@ Opal.version = "0.3.27";
|
|
2296
2235
|
|
2297
2236
|
};
|
2298
2237
|
|
2299
|
-
|
2300
|
-
Array_prototype.$index = TMP_31 = function(object) {
|
2238
|
+
Array_prototype.$index = TMP_8 = function(object) {
|
2301
2239
|
var __context, block;
|
2302
|
-
block =
|
2240
|
+
block = TMP_8._p || nil, __context = block._s, TMP_8._p = null;
|
2303
2241
|
|
2304
2242
|
|
2305
2243
|
if (object != null) {
|
@@ -2325,7 +2263,6 @@ Opal.version = "0.3.27";
|
|
2325
2263
|
|
2326
2264
|
};
|
2327
2265
|
|
2328
|
-
// line 1615, (corelib), Array#insert
|
2329
2266
|
Array_prototype.$insert = function(index, objects) {
|
2330
2267
|
objects = __slice.call(arguments, 1);
|
2331
2268
|
|
@@ -2349,7 +2286,6 @@ Opal.version = "0.3.27";
|
|
2349
2286
|
return this;
|
2350
2287
|
};
|
2351
2288
|
|
2352
|
-
// line 1638, (corelib), Array#inspect
|
2353
2289
|
Array_prototype.$inspect = function() {
|
2354
2290
|
|
2355
2291
|
|
@@ -2371,7 +2307,6 @@ Opal.version = "0.3.27";
|
|
2371
2307
|
|
2372
2308
|
};
|
2373
2309
|
|
2374
|
-
// line 1658, (corelib), Array#join
|
2375
2310
|
Array_prototype.$join = function(sep) {
|
2376
2311
|
if (sep == null) {
|
2377
2312
|
sep = ""
|
@@ -2387,10 +2322,9 @@ Opal.version = "0.3.27";
|
|
2387
2322
|
|
2388
2323
|
};
|
2389
2324
|
|
2390
|
-
|
2391
|
-
Array_prototype.$keep_if = TMP_32 = function() {
|
2325
|
+
Array_prototype.$keep_if = TMP_9 = function() {
|
2392
2326
|
var __context, block;
|
2393
|
-
block =
|
2327
|
+
block = TMP_9._p || nil, __context = block._s, TMP_9._p = null;
|
2394
2328
|
|
2395
2329
|
|
2396
2330
|
for (var i = 0, length = this.length, value; i < length; i++) {
|
@@ -2409,7 +2343,6 @@ Opal.version = "0.3.27";
|
|
2409
2343
|
return this;
|
2410
2344
|
};
|
2411
2345
|
|
2412
|
-
// line 1689, (corelib), Array#last
|
2413
2346
|
Array_prototype.$last = function(count) {
|
2414
2347
|
|
2415
2348
|
|
@@ -2430,7 +2363,6 @@ Opal.version = "0.3.27";
|
|
2430
2363
|
|
2431
2364
|
};
|
2432
2365
|
|
2433
|
-
// line 1708, (corelib), Array#length
|
2434
2366
|
Array_prototype.$length = function() {
|
2435
2367
|
|
2436
2368
|
return this.length;
|
@@ -2440,7 +2372,6 @@ Opal.version = "0.3.27";
|
|
2440
2372
|
|
2441
2373
|
Array_prototype['$map!'] = Array_prototype['$collect!'];
|
2442
2374
|
|
2443
|
-
// line 1716, (corelib), Array#pop
|
2444
2375
|
Array_prototype.$pop = function(count) {
|
2445
2376
|
|
2446
2377
|
|
@@ -2458,7 +2389,6 @@ Opal.version = "0.3.27";
|
|
2458
2389
|
|
2459
2390
|
};
|
2460
2391
|
|
2461
|
-
// line 1732, (corelib), Array#push
|
2462
2392
|
Array_prototype.$push = function(objects) {
|
2463
2393
|
objects = __slice.call(arguments, 0);
|
2464
2394
|
|
@@ -2469,7 +2399,6 @@ Opal.version = "0.3.27";
|
|
2469
2399
|
return this;
|
2470
2400
|
};
|
2471
2401
|
|
2472
|
-
// line 1742, (corelib), Array#rassoc
|
2473
2402
|
Array_prototype.$rassoc = function(object) {
|
2474
2403
|
|
2475
2404
|
|
@@ -2487,10 +2416,9 @@ Opal.version = "0.3.27";
|
|
2487
2416
|
|
2488
2417
|
};
|
2489
2418
|
|
2490
|
-
|
2491
|
-
Array_prototype.$reject = TMP_33 = function() {
|
2419
|
+
Array_prototype.$reject = TMP_10 = function() {
|
2492
2420
|
var __context, block;
|
2493
|
-
block =
|
2421
|
+
block = TMP_10._p || nil, __context = block._s, TMP_10._p = null;
|
2494
2422
|
|
2495
2423
|
|
2496
2424
|
var result = [];
|
@@ -2508,32 +2436,17 @@ Opal.version = "0.3.27";
|
|
2508
2436
|
|
2509
2437
|
};
|
2510
2438
|
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
block = TMP_34._p || nil, __context = block._s, TMP_34._p = null;
|
2439
|
+
Array_prototype['$reject!'] = TMP_11 = function() {
|
2440
|
+
var __a, __context, block;
|
2441
|
+
block = TMP_11._p || nil, __context = block._s, TMP_11._p = null;
|
2515
2442
|
|
2516
2443
|
|
2517
2444
|
var original = this.length;
|
2518
|
-
|
2519
|
-
|
2520
|
-
if ((value = block.call(__context, this[i])) === __breaker) {
|
2521
|
-
return __breaker.$v;
|
2522
|
-
}
|
2523
|
-
|
2524
|
-
if (value !== false && value !== nil) {
|
2525
|
-
this.splice(i, 1);
|
2526
|
-
|
2527
|
-
length--;
|
2528
|
-
i--;
|
2529
|
-
}
|
2530
|
-
}
|
2531
|
-
|
2532
|
-
return original === this.length ? nil : this;
|
2445
|
+
(__a = this, __a.$delete_if._p = block.$to_proc(), __a.$delete_if());
|
2446
|
+
return this.length === original ? nil : this;
|
2533
2447
|
|
2534
2448
|
};
|
2535
2449
|
|
2536
|
-
// line 1796, (corelib), Array#replace
|
2537
2450
|
Array_prototype.$replace = function(other) {
|
2538
2451
|
|
2539
2452
|
|
@@ -2545,7 +2458,6 @@ Opal.version = "0.3.27";
|
|
2545
2458
|
|
2546
2459
|
Array_prototype.$reverse = Array_prototype.reverse;
|
2547
2460
|
|
2548
|
-
// line 1806, (corelib), Array#reverse!
|
2549
2461
|
Array_prototype['$reverse!'] = function() {
|
2550
2462
|
|
2551
2463
|
|
@@ -2555,19 +2467,17 @@ Opal.version = "0.3.27";
|
|
2555
2467
|
|
2556
2468
|
};
|
2557
2469
|
|
2558
|
-
|
2559
|
-
Array_prototype.$reverse_each = TMP_35 = function() {
|
2470
|
+
Array_prototype.$reverse_each = TMP_12 = function() {
|
2560
2471
|
var __a, __context, block;
|
2561
|
-
block =
|
2472
|
+
block = TMP_12._p || nil, __context = block._s, TMP_12._p = null;
|
2562
2473
|
|
2563
2474
|
(__a = this.$reverse(), __a.$each._p = block.$to_proc(), __a.$each());
|
2564
2475
|
return this;
|
2565
2476
|
};
|
2566
2477
|
|
2567
|
-
|
2568
|
-
Array_prototype.$rindex = TMP_36 = function(object) {
|
2478
|
+
Array_prototype.$rindex = TMP_13 = function(object) {
|
2569
2479
|
var __context, block;
|
2570
|
-
block =
|
2480
|
+
block = TMP_13._p || nil, __context = block._s, TMP_13._p = null;
|
2571
2481
|
|
2572
2482
|
|
2573
2483
|
if (block !== nil) {
|
@@ -2593,10 +2503,9 @@ Opal.version = "0.3.27";
|
|
2593
2503
|
|
2594
2504
|
};
|
2595
2505
|
|
2596
|
-
|
2597
|
-
Array_prototype.$select = TMP_37 = function() {
|
2506
|
+
Array_prototype.$select = TMP_14 = function() {
|
2598
2507
|
var __context, block;
|
2599
|
-
block =
|
2508
|
+
block = TMP_14._p || nil, __context = block._s, TMP_14._p = null;
|
2600
2509
|
|
2601
2510
|
|
2602
2511
|
var result = [];
|
@@ -2617,34 +2526,17 @@ Opal.version = "0.3.27";
|
|
2617
2526
|
|
2618
2527
|
};
|
2619
2528
|
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
block = TMP_38._p || nil, __context = block._s, TMP_38._p = null;
|
2529
|
+
Array_prototype['$select!'] = TMP_15 = function() {
|
2530
|
+
var __a, __context, block;
|
2531
|
+
block = TMP_15._p || nil, __context = block._s, TMP_15._p = null;
|
2624
2532
|
|
2625
2533
|
|
2626
2534
|
var original = this.length;
|
2627
|
-
|
2628
|
-
for (var i = 0, length = original, item, value; i < length; i++) {
|
2629
|
-
item = this[i];
|
2630
|
-
|
2631
|
-
if ((value = block(__context, item)) === __breaker) {
|
2632
|
-
return __breaker.$v;
|
2633
|
-
}
|
2634
|
-
|
2635
|
-
if (value === false || value === nil) {
|
2636
|
-
this.splice(i, 1);
|
2637
|
-
|
2638
|
-
length--;
|
2639
|
-
i--;
|
2640
|
-
}
|
2641
|
-
}
|
2642
|
-
|
2535
|
+
(__a = this, __a.$keep_if._p = block.$to_proc(), __a.$keep_if());
|
2643
2536
|
return this.length === original ? nil : this;
|
2644
2537
|
|
2645
2538
|
};
|
2646
2539
|
|
2647
|
-
// line 1888, (corelib), Array#shift
|
2648
2540
|
Array_prototype.$shift = function(count) {
|
2649
2541
|
|
2650
2542
|
|
@@ -2660,7 +2552,6 @@ Opal.version = "0.3.27";
|
|
2660
2552
|
|
2661
2553
|
Array_prototype.$slice = Array_prototype['$[]'];
|
2662
2554
|
|
2663
|
-
// line 1902, (corelib), Array#slice!
|
2664
2555
|
Array_prototype['$slice!'] = function(index, length) {
|
2665
2556
|
|
2666
2557
|
|
@@ -2680,16 +2571,14 @@ Opal.version = "0.3.27";
|
|
2680
2571
|
|
2681
2572
|
};
|
2682
2573
|
|
2683
|
-
// line 1920, (corelib), Array#take
|
2684
2574
|
Array_prototype.$take = function(count) {
|
2685
2575
|
|
2686
2576
|
return this.slice(0, count);
|
2687
2577
|
};
|
2688
2578
|
|
2689
|
-
|
2690
|
-
Array_prototype.$take_while = TMP_39 = function() {
|
2579
|
+
Array_prototype.$take_while = TMP_16 = function() {
|
2691
2580
|
var __context, block;
|
2692
|
-
block =
|
2581
|
+
block = TMP_16._p || nil, __context = block._s, TMP_16._p = null;
|
2693
2582
|
|
2694
2583
|
|
2695
2584
|
var result = [];
|
@@ -2712,7 +2601,6 @@ Opal.version = "0.3.27";
|
|
2712
2601
|
|
2713
2602
|
};
|
2714
2603
|
|
2715
|
-
// line 1946, (corelib), Array#to_a
|
2716
2604
|
Array_prototype.$to_a = function() {
|
2717
2605
|
|
2718
2606
|
return this;
|
@@ -2720,7 +2608,6 @@ Opal.version = "0.3.27";
|
|
2720
2608
|
|
2721
2609
|
Array_prototype.$to_ary = Array_prototype.$to_a;
|
2722
2610
|
|
2723
|
-
// line 1952, (corelib), Array#to_json
|
2724
2611
|
Array_prototype.$to_json = function() {
|
2725
2612
|
|
2726
2613
|
|
@@ -2736,7 +2623,6 @@ Opal.version = "0.3.27";
|
|
2736
2623
|
|
2737
2624
|
Array_prototype.$to_s = Array_prototype.$inspect;
|
2738
2625
|
|
2739
|
-
// line 1966, (corelib), Array#uniq
|
2740
2626
|
Array_prototype.$uniq = function() {
|
2741
2627
|
|
2742
2628
|
|
@@ -2758,7 +2644,6 @@ Opal.version = "0.3.27";
|
|
2758
2644
|
|
2759
2645
|
};
|
2760
2646
|
|
2761
|
-
// line 1986, (corelib), Array#uniq!
|
2762
2647
|
Array_prototype['$uniq!'] = function() {
|
2763
2648
|
|
2764
2649
|
|
@@ -2784,7 +2669,6 @@ Opal.version = "0.3.27";
|
|
2784
2669
|
|
2785
2670
|
};
|
2786
2671
|
|
2787
|
-
// line 2010, (corelib), Array#unshift
|
2788
2672
|
Array_prototype.$unshift = function(objects) {
|
2789
2673
|
objects = __slice.call(arguments, 0);
|
2790
2674
|
|
@@ -2796,10 +2680,9 @@ Opal.version = "0.3.27";
|
|
2796
2680
|
|
2797
2681
|
};
|
2798
2682
|
|
2799
|
-
|
2800
|
-
Array_prototype.$zip = TMP_40 = function(others) {
|
2683
|
+
Array_prototype.$zip = TMP_17 = function(others) {
|
2801
2684
|
var __context, block;
|
2802
|
-
block =
|
2685
|
+
block = TMP_17._p || nil, __context = block._s, TMP_17._p = null;
|
2803
2686
|
others = __slice.call(arguments, 0);
|
2804
2687
|
|
2805
2688
|
var result = [], size = this.length, part, o;
|
@@ -2831,13 +2714,18 @@ Opal.version = "0.3.27";
|
|
2831
2714
|
return result;
|
2832
2715
|
|
2833
2716
|
};
|
2834
|
-
|
2835
|
-
|
2836
|
-
(
|
2837
|
-
|
2717
|
+
|
2718
|
+
return nil;
|
2719
|
+
})(self, Array)
|
2720
|
+
})();
|
2721
|
+
(function() {
|
2722
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
2723
|
+
|
2724
|
+
return (function(__base, __super){
|
2838
2725
|
function Hash() {};
|
2839
2726
|
Hash = __klass(__base, __super, "Hash", Hash);
|
2840
|
-
|
2727
|
+
|
2728
|
+
;Hash._sdonate(["$[]", "$allocate", "$from_native", "$new"]); var Hash_prototype = Hash.prototype, __scope = Hash._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11, TMP_12;
|
2841
2729
|
Hash_prototype.proc = Hash_prototype.none = nil;
|
2842
2730
|
|
2843
2731
|
Hash.$include(__scope.Enumerable);
|
@@ -2846,49 +2734,64 @@ Opal.version = "0.3.27";
|
|
2846
2734
|
__hash = Opal.hash = function() {
|
2847
2735
|
var hash = new Hash,
|
2848
2736
|
args = __slice.call(arguments),
|
2737
|
+
keys = [],
|
2849
2738
|
assocs = {};
|
2850
2739
|
|
2851
2740
|
hash.map = assocs;
|
2741
|
+
hash.keys = keys;
|
2852
2742
|
|
2853
2743
|
for (var i = 0, length = args.length, key; i < length; i++) {
|
2854
|
-
key = args[i];
|
2855
|
-
|
2744
|
+
var key = args[i], obj = args[++i];
|
2745
|
+
|
2746
|
+
if (assocs[key] == null) {
|
2747
|
+
keys.push(key);
|
2748
|
+
}
|
2749
|
+
|
2750
|
+
assocs[key] = obj;
|
2856
2751
|
}
|
2857
2752
|
|
2858
2753
|
return hash;
|
2859
2754
|
};
|
2755
|
+
|
2756
|
+
// hash2 is a faster creator for hashes that just use symbols and
|
2757
|
+
// strings as keys. The map and keys array can be constructed at
|
2758
|
+
// compile time, so they are just added here by the constructor
|
2759
|
+
// function
|
2760
|
+
__hash2 = Opal.hash2 = function(keys, map) {
|
2761
|
+
var hash = new Hash;
|
2762
|
+
hash.keys = keys;
|
2763
|
+
hash.map = map;
|
2764
|
+
return hash;
|
2765
|
+
}
|
2860
2766
|
|
2861
2767
|
|
2862
|
-
// line 2072, (corelib), Hash.[]
|
2863
2768
|
Hash['$[]'] = function(objs) {
|
2864
2769
|
objs = __slice.call(arguments, 0);
|
2865
2770
|
return __hash.apply(null, objs);
|
2866
2771
|
};
|
2867
2772
|
|
2868
|
-
// line 2076, (corelib), Hash.allocate
|
2869
2773
|
Hash.$allocate = function() {
|
2870
2774
|
|
2871
2775
|
return __hash();
|
2872
2776
|
};
|
2873
2777
|
|
2874
|
-
// line 2080, (corelib), Hash.from_native
|
2875
2778
|
Hash.$from_native = function(obj) {
|
2876
2779
|
|
2877
2780
|
|
2878
|
-
var hash = __hash(), map = hash.map;
|
2781
|
+
var hash = __hash(), map = hash.map, keys = hash.keys;
|
2879
2782
|
|
2880
2783
|
for (var key in obj) {
|
2881
|
-
|
2784
|
+
keys.push(key);
|
2785
|
+
map[key] = obj[key];
|
2882
2786
|
}
|
2883
2787
|
|
2884
2788
|
return hash;
|
2885
2789
|
|
2886
2790
|
};
|
2887
2791
|
|
2888
|
-
|
2889
|
-
Hash.$new = TMP_41 = function(defaults) {
|
2792
|
+
Hash.$new = TMP_1 = function(defaults) {
|
2890
2793
|
var __context, block;
|
2891
|
-
block =
|
2794
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
2892
2795
|
|
2893
2796
|
|
2894
2797
|
var hash = __hash();
|
@@ -2904,30 +2807,28 @@ Opal.version = "0.3.27";
|
|
2904
2807
|
|
2905
2808
|
};
|
2906
2809
|
|
2907
|
-
// line 2107, (corelib), Hash#==
|
2908
2810
|
Hash_prototype['$=='] = function(other) {
|
2909
|
-
|
2811
|
+
var __a;
|
2910
2812
|
|
2911
2813
|
if (this === other) {
|
2912
2814
|
return true;
|
2913
2815
|
}
|
2914
2816
|
|
2915
|
-
if (!other.map) {
|
2817
|
+
if (!other.map || !other.keys) {
|
2818
|
+
return false;
|
2819
|
+
}
|
2820
|
+
|
2821
|
+
if (this.keys.length !== other.keys.length) {
|
2916
2822
|
return false;
|
2917
2823
|
}
|
2918
2824
|
|
2919
2825
|
var map = this.map,
|
2920
2826
|
map2 = other.map;
|
2921
2827
|
|
2922
|
-
for (var
|
2923
|
-
|
2924
|
-
return false;
|
2925
|
-
}
|
2926
|
-
|
2927
|
-
var obj = map[assoc][1],
|
2928
|
-
obj2 = map2[assoc][1];
|
2828
|
+
for (var i = 0, length = this.keys.length; i < length; i++) {
|
2829
|
+
var key = this.keys[i], obj = map[key], obj2 = map2[key];
|
2929
2830
|
|
2930
|
-
if (
|
2831
|
+
if ((__a = (obj)['$=='](obj2), (__a === nil || __a === false))) {
|
2931
2832
|
return false;
|
2932
2833
|
}
|
2933
2834
|
}
|
@@ -2936,14 +2837,13 @@ Opal.version = "0.3.27";
|
|
2936
2837
|
|
2937
2838
|
};
|
2938
2839
|
|
2939
|
-
// line 2137, (corelib), Hash#[]
|
2940
2840
|
Hash_prototype['$[]'] = function(key) {
|
2941
2841
|
|
2942
2842
|
|
2943
|
-
var bucket;
|
2843
|
+
var bucket = this.map[key];
|
2944
2844
|
|
2945
|
-
if (bucket
|
2946
|
-
return bucket
|
2845
|
+
if (bucket != null) {
|
2846
|
+
return bucket;
|
2947
2847
|
}
|
2948
2848
|
|
2949
2849
|
var proc = this.proc;
|
@@ -2956,25 +2856,31 @@ Opal.version = "0.3.27";
|
|
2956
2856
|
|
2957
2857
|
};
|
2958
2858
|
|
2959
|
-
// line 2155, (corelib), Hash#[]=
|
2960
2859
|
Hash_prototype['$[]='] = function(key, value) {
|
2961
2860
|
|
2962
2861
|
|
2963
|
-
|
2862
|
+
var map = this.map;
|
2863
|
+
|
2864
|
+
if (!__hasOwn.call(map, key)) {
|
2865
|
+
this.keys.push(key);
|
2866
|
+
}
|
2867
|
+
|
2868
|
+
map[key] = value;
|
2964
2869
|
|
2965
2870
|
return value;
|
2966
2871
|
|
2967
2872
|
};
|
2968
2873
|
|
2969
|
-
// line 2163, (corelib), Hash#assoc
|
2970
2874
|
Hash_prototype.$assoc = function(object) {
|
2971
2875
|
|
2972
2876
|
|
2973
|
-
|
2974
|
-
var bucket = this.map[assoc];
|
2877
|
+
var keys = this.keys, key;
|
2975
2878
|
|
2976
|
-
|
2977
|
-
|
2879
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
2880
|
+
key = keys[i];
|
2881
|
+
|
2882
|
+
if ((key)['$=='](object)) {
|
2883
|
+
return [key, this.map[key]];
|
2978
2884
|
}
|
2979
2885
|
}
|
2980
2886
|
|
@@ -2982,66 +2888,61 @@ Opal.version = "0.3.27";
|
|
2982
2888
|
|
2983
2889
|
};
|
2984
2890
|
|
2985
|
-
// line 2177, (corelib), Hash#clear
|
2986
2891
|
Hash_prototype.$clear = function() {
|
2987
2892
|
|
2988
2893
|
|
2989
2894
|
this.map = {};
|
2990
|
-
|
2895
|
+
this.keys = [];
|
2991
2896
|
return this;
|
2992
2897
|
|
2993
2898
|
};
|
2994
2899
|
|
2995
|
-
// line 2185, (corelib), Hash#clone
|
2996
2900
|
Hash_prototype.$clone = function() {
|
2997
2901
|
|
2998
2902
|
|
2999
2903
|
var result = __hash(),
|
3000
2904
|
map = this.map,
|
3001
|
-
map2 = result.map
|
2905
|
+
map2 = result.map,
|
2906
|
+
keys2 = result.keys;
|
3002
2907
|
|
3003
|
-
for (var
|
3004
|
-
|
2908
|
+
for (var i = 0, length = this.keys.length; i < length; i++) {
|
2909
|
+
keys2.push(this.keys[i]);
|
2910
|
+
map2[this.keys[i]] = map[this.keys[i]];
|
3005
2911
|
}
|
3006
2912
|
|
3007
2913
|
return result;
|
3008
2914
|
|
3009
2915
|
};
|
3010
2916
|
|
3011
|
-
// line 2199, (corelib), Hash#default
|
3012
2917
|
Hash_prototype.$default = function() {
|
3013
2918
|
|
3014
2919
|
return this.none;
|
3015
2920
|
};
|
3016
2921
|
|
3017
|
-
// line 2203, (corelib), Hash#default=
|
3018
2922
|
Hash_prototype['$default='] = function(object) {
|
3019
2923
|
|
3020
2924
|
return this.none = object;
|
3021
2925
|
};
|
3022
2926
|
|
3023
|
-
// line 2207, (corelib), Hash#default_proc
|
3024
2927
|
Hash_prototype.$default_proc = function() {
|
3025
2928
|
|
3026
2929
|
return this.proc;
|
3027
2930
|
};
|
3028
2931
|
|
3029
|
-
// line 2211, (corelib), Hash#default_proc=
|
3030
2932
|
Hash_prototype['$default_proc='] = function(proc) {
|
3031
2933
|
|
3032
2934
|
return this.proc = proc;
|
3033
2935
|
};
|
3034
2936
|
|
3035
|
-
// line 2215, (corelib), Hash#delete
|
3036
2937
|
Hash_prototype.$delete = function(key) {
|
3037
2938
|
|
3038
2939
|
|
3039
|
-
var map = this.map, result;
|
3040
|
-
|
3041
|
-
if (result = map[key]) {
|
3042
|
-
result = result[1];
|
2940
|
+
var map = this.map, result = map[key];
|
3043
2941
|
|
2942
|
+
if (result != null) {
|
3044
2943
|
delete map[key];
|
2944
|
+
this.keys.$delete(key);
|
2945
|
+
|
3045
2946
|
return result;
|
3046
2947
|
}
|
3047
2948
|
|
@@ -3049,24 +2950,26 @@ Opal.version = "0.3.27";
|
|
3049
2950
|
|
3050
2951
|
};
|
3051
2952
|
|
3052
|
-
|
3053
|
-
Hash_prototype.$delete_if = TMP_42 = function() {
|
2953
|
+
Hash_prototype.$delete_if = TMP_2 = function() {
|
3054
2954
|
var __context, block;
|
3055
|
-
block =
|
2955
|
+
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
3056
2956
|
|
3057
2957
|
|
3058
|
-
var map = this.map;
|
2958
|
+
var map = this.map, keys = this.keys, value;
|
3059
2959
|
|
3060
|
-
for (var
|
3061
|
-
var
|
3062
|
-
value;
|
2960
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
2961
|
+
var key = keys[i], obj = map[key];
|
3063
2962
|
|
3064
|
-
if ((value = block.call(__context,
|
2963
|
+
if ((value = block.call(__context, key, obj)) === __breaker) {
|
3065
2964
|
return __breaker.$v;
|
3066
2965
|
}
|
3067
2966
|
|
3068
2967
|
if (value !== false && value !== nil) {
|
3069
|
-
|
2968
|
+
keys.splice(i, 1);
|
2969
|
+
delete map[key];
|
2970
|
+
|
2971
|
+
length--;
|
2972
|
+
i--;
|
3070
2973
|
}
|
3071
2974
|
}
|
3072
2975
|
|
@@ -3076,18 +2979,17 @@ Opal.version = "0.3.27";
|
|
3076
2979
|
|
3077
2980
|
Hash_prototype.$dup = Hash_prototype.$clone;
|
3078
2981
|
|
3079
|
-
|
3080
|
-
Hash_prototype.$each = TMP_43 = function() {
|
2982
|
+
Hash_prototype.$each = TMP_3 = function() {
|
3081
2983
|
var __context, block;
|
3082
|
-
block =
|
2984
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
3083
2985
|
|
3084
2986
|
|
3085
|
-
var map = this.map;
|
2987
|
+
var map = this.map, keys = this.keys;
|
3086
2988
|
|
3087
|
-
for (var
|
3088
|
-
var
|
2989
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
2990
|
+
var key = keys[i];
|
3089
2991
|
|
3090
|
-
if (block.call(__context,
|
2992
|
+
if (block.call(__context, key, map[key]) === __breaker) {
|
3091
2993
|
return __breaker.$v;
|
3092
2994
|
}
|
3093
2995
|
}
|
@@ -3096,18 +2998,17 @@ Opal.version = "0.3.27";
|
|
3096
2998
|
|
3097
2999
|
};
|
3098
3000
|
|
3099
|
-
|
3100
|
-
Hash_prototype.$each_key = TMP_44 = function() {
|
3001
|
+
Hash_prototype.$each_key = TMP_4 = function() {
|
3101
3002
|
var __context, block;
|
3102
|
-
block =
|
3003
|
+
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
3103
3004
|
|
3104
3005
|
|
3105
|
-
var
|
3006
|
+
var keys = this.keys;
|
3106
3007
|
|
3107
|
-
for (var
|
3108
|
-
var
|
3008
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3009
|
+
var key = keys[i];
|
3109
3010
|
|
3110
|
-
if (block.call(__context,
|
3011
|
+
if (block.call(__context, key) === __breaker) {
|
3111
3012
|
return __breaker.$v;
|
3112
3013
|
}
|
3113
3014
|
}
|
@@ -3118,18 +3019,15 @@ Opal.version = "0.3.27";
|
|
3118
3019
|
|
3119
3020
|
Hash_prototype.$each_pair = Hash_prototype.$each;
|
3120
3021
|
|
3121
|
-
|
3122
|
-
Hash_prototype.$each_value = TMP_45 = function() {
|
3022
|
+
Hash_prototype.$each_value = TMP_5 = function() {
|
3123
3023
|
var __context, block;
|
3124
|
-
block =
|
3024
|
+
block = TMP_5._p || nil, __context = block._s, TMP_5._p = null;
|
3125
3025
|
|
3126
3026
|
|
3127
|
-
var map = this.map;
|
3027
|
+
var map = this.map, keys = this.keys;
|
3128
3028
|
|
3129
|
-
for (var
|
3130
|
-
|
3131
|
-
|
3132
|
-
if (block.call(__context, bucket[1]) === __breaker) {
|
3029
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3030
|
+
if (block.call(__context, map[keys[i]]) === __breaker) {
|
3133
3031
|
return __breaker.$v;
|
3134
3032
|
}
|
3135
3033
|
}
|
@@ -3138,30 +3036,24 @@ Opal.version = "0.3.27";
|
|
3138
3036
|
|
3139
3037
|
};
|
3140
3038
|
|
3141
|
-
// line 2303, (corelib), Hash#empty?
|
3142
3039
|
Hash_prototype['$empty?'] = function() {
|
3143
3040
|
|
3144
3041
|
|
3145
|
-
|
3146
|
-
return false;
|
3147
|
-
}
|
3148
|
-
|
3149
|
-
return true;
|
3042
|
+
return this.keys.length === 0;
|
3150
3043
|
|
3151
3044
|
};
|
3152
3045
|
|
3153
3046
|
Hash_prototype['$eql?'] = Hash_prototype['$=='];
|
3154
3047
|
|
3155
|
-
|
3156
|
-
Hash_prototype.$fetch = TMP_46 = function(key, defaults) {
|
3048
|
+
Hash_prototype.$fetch = TMP_6 = function(key, defaults) {
|
3157
3049
|
var __context, block;
|
3158
|
-
block =
|
3050
|
+
block = TMP_6._p || nil, __context = block._s, TMP_6._p = null;
|
3159
3051
|
|
3160
3052
|
|
3161
|
-
var
|
3053
|
+
var value = this.map[key];
|
3162
3054
|
|
3163
|
-
if (
|
3164
|
-
return
|
3055
|
+
if (value != null) {
|
3056
|
+
return value;
|
3165
3057
|
}
|
3166
3058
|
|
3167
3059
|
if (block !== nil) {
|
@@ -3182,17 +3074,13 @@ Opal.version = "0.3.27";
|
|
3182
3074
|
|
3183
3075
|
};
|
3184
3076
|
|
3185
|
-
// line 2341, (corelib), Hash#flatten
|
3186
3077
|
Hash_prototype.$flatten = function(level) {
|
3187
|
-
var __a, __b;
|
3188
3078
|
|
3189
|
-
|
3190
|
-
|
3079
|
+
|
3080
|
+
var map = this.map, keys = this.keys, result = [];
|
3191
3081
|
|
3192
|
-
for (var
|
3193
|
-
var
|
3194
|
-
key = bucket[0],
|
3195
|
-
value = bucket[1];
|
3082
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3083
|
+
var key = keys[i], value = map[key];
|
3196
3084
|
|
3197
3085
|
result.push(key);
|
3198
3086
|
|
@@ -3201,7 +3089,7 @@ Opal.version = "0.3.27";
|
|
3201
3089
|
result.push(value);
|
3202
3090
|
}
|
3203
3091
|
else {
|
3204
|
-
result = result.concat((value).$flatten(
|
3092
|
+
result = result.concat((value).$flatten(level - 1));
|
3205
3093
|
}
|
3206
3094
|
}
|
3207
3095
|
else {
|
@@ -3213,18 +3101,16 @@ Opal.version = "0.3.27";
|
|
3213
3101
|
|
3214
3102
|
};
|
3215
3103
|
|
3216
|
-
// line 2370, (corelib), Hash#has_key?
|
3217
3104
|
Hash_prototype['$has_key?'] = function(key) {
|
3218
3105
|
|
3219
|
-
return
|
3106
|
+
return this.map[key] != null;
|
3220
3107
|
};
|
3221
3108
|
|
3222
|
-
// line 2374, (corelib), Hash#has_value?
|
3223
3109
|
Hash_prototype['$has_value?'] = function(value) {
|
3224
3110
|
|
3225
3111
|
|
3226
3112
|
for (var assoc in this.map) {
|
3227
|
-
if ((this.map[assoc]
|
3113
|
+
if ((this.map[assoc])['$=='](value)) {
|
3228
3114
|
return true;
|
3229
3115
|
}
|
3230
3116
|
}
|
@@ -3233,7 +3119,6 @@ Opal.version = "0.3.27";
|
|
3233
3119
|
|
3234
3120
|
};
|
3235
3121
|
|
3236
|
-
// line 2386, (corelib), Hash#hash
|
3237
3122
|
Hash_prototype.$hash = function() {
|
3238
3123
|
|
3239
3124
|
return this._id;
|
@@ -3241,15 +3126,16 @@ Opal.version = "0.3.27";
|
|
3241
3126
|
|
3242
3127
|
Hash_prototype['$include?'] = Hash_prototype['$has_key?'];
|
3243
3128
|
|
3244
|
-
// line 2392, (corelib), Hash#index
|
3245
3129
|
Hash_prototype.$index = function(object) {
|
3246
3130
|
|
3247
3131
|
|
3248
|
-
|
3249
|
-
|
3132
|
+
var map = this.map, keys = this.keys;
|
3133
|
+
|
3134
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3135
|
+
var key = keys[i];
|
3250
3136
|
|
3251
|
-
if (object['$=='](
|
3252
|
-
return
|
3137
|
+
if (object['$=='](map[key])) {
|
3138
|
+
return key;
|
3253
3139
|
}
|
3254
3140
|
}
|
3255
3141
|
|
@@ -3257,17 +3143,16 @@ Opal.version = "0.3.27";
|
|
3257
3143
|
|
3258
3144
|
};
|
3259
3145
|
|
3260
|
-
// line 2406, (corelib), Hash#indexes
|
3261
3146
|
Hash_prototype.$indexes = function(keys) {
|
3262
3147
|
keys = __slice.call(arguments, 0);
|
3263
3148
|
|
3264
|
-
var result = [], map = this.map,
|
3149
|
+
var result = [], map = this.map, val;
|
3265
3150
|
|
3266
3151
|
for (var i = 0, length = keys.length; i < length; i++) {
|
3267
|
-
var key = keys[i];
|
3152
|
+
var key = keys[i], val = map[key];
|
3268
3153
|
|
3269
|
-
if (
|
3270
|
-
result.push(
|
3154
|
+
if (val != null) {
|
3155
|
+
result.push(val);
|
3271
3156
|
}
|
3272
3157
|
else {
|
3273
3158
|
result.push(this.none);
|
@@ -3280,57 +3165,57 @@ Opal.version = "0.3.27";
|
|
3280
3165
|
|
3281
3166
|
Hash_prototype.$indices = Hash_prototype.$indexes;
|
3282
3167
|
|
3283
|
-
// line 2427, (corelib), Hash#inspect
|
3284
3168
|
Hash_prototype.$inspect = function() {
|
3285
3169
|
|
3286
3170
|
|
3287
|
-
var inspect = [],
|
3288
|
-
map = this.map;
|
3289
|
-
|
3290
|
-
for (var assoc in map) {
|
3291
|
-
var bucket = map[assoc];
|
3171
|
+
var inspect = [], keys = this.keys, map = this.map;
|
3292
3172
|
|
3293
|
-
|
3173
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3174
|
+
var key = keys[i];
|
3175
|
+
inspect.push((key).$inspect() + '=>' + (map[key]).$inspect());
|
3294
3176
|
}
|
3177
|
+
|
3295
3178
|
return '{' + inspect.join(', ') + '}';
|
3296
3179
|
|
3297
3180
|
};
|
3298
3181
|
|
3299
|
-
// line 2441, (corelib), Hash#invert
|
3300
3182
|
Hash_prototype.$invert = function() {
|
3301
3183
|
|
3302
3184
|
|
3303
|
-
var result = __hash(),
|
3304
|
-
|
3305
|
-
map2 = result.map;
|
3185
|
+
var result = __hash(), keys = this.keys, map = this.map,
|
3186
|
+
keys2 = result.keys, map2 = result.map;
|
3306
3187
|
|
3307
|
-
for (var
|
3308
|
-
var
|
3188
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3189
|
+
var key = keys[i], obj = map[key];
|
3309
3190
|
|
3310
|
-
|
3191
|
+
keys2.push(obj);
|
3192
|
+
map2[obj] = key;
|
3311
3193
|
}
|
3312
3194
|
|
3313
3195
|
return result;
|
3314
3196
|
|
3315
3197
|
};
|
3316
3198
|
|
3317
|
-
|
3318
|
-
Hash_prototype.$keep_if = TMP_47 = function() {
|
3199
|
+
Hash_prototype.$keep_if = TMP_7 = function() {
|
3319
3200
|
var __context, block;
|
3320
|
-
block =
|
3201
|
+
block = TMP_7._p || nil, __context = block._s, TMP_7._p = null;
|
3321
3202
|
|
3322
3203
|
|
3323
|
-
var map = this.map, value;
|
3204
|
+
var map = this.map, keys = this.keys, value;
|
3324
3205
|
|
3325
|
-
for (var
|
3326
|
-
var
|
3206
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3207
|
+
var key = keys[i], obj = map[key];
|
3327
3208
|
|
3328
|
-
if ((value = block.call(__context,
|
3209
|
+
if ((value = block.call(__context, key, obj)) === __breaker) {
|
3329
3210
|
return __breaker.$v;
|
3330
3211
|
}
|
3331
3212
|
|
3332
3213
|
if (value === false || value === nil) {
|
3333
|
-
|
3214
|
+
keys.splice(i, 1);
|
3215
|
+
delete map[key];
|
3216
|
+
|
3217
|
+
length--;
|
3218
|
+
i--;
|
3334
3219
|
}
|
3335
3220
|
}
|
3336
3221
|
|
@@ -3342,70 +3227,61 @@ Opal.version = "0.3.27";
|
|
3342
3227
|
|
3343
3228
|
Hash_prototype['$key?'] = Hash_prototype['$has_key?'];
|
3344
3229
|
|
3345
|
-
// line 2481, (corelib), Hash#keys
|
3346
3230
|
Hash_prototype.$keys = function() {
|
3347
3231
|
|
3348
3232
|
|
3349
|
-
|
3350
|
-
|
3351
|
-
for (var assoc in this.map) {
|
3352
|
-
result.push(this.map[assoc][0]);
|
3353
|
-
}
|
3354
|
-
|
3355
|
-
return result;
|
3233
|
+
return this.keys.slice(0);
|
3356
3234
|
|
3357
3235
|
};
|
3358
3236
|
|
3359
|
-
// line 2493, (corelib), Hash#length
|
3360
3237
|
Hash_prototype.$length = function() {
|
3361
3238
|
|
3362
3239
|
|
3363
|
-
|
3364
|
-
|
3365
|
-
for (var assoc in this.map) {
|
3366
|
-
result++;
|
3367
|
-
}
|
3368
|
-
|
3369
|
-
return result;
|
3240
|
+
return this.keys.length;
|
3370
3241
|
|
3371
3242
|
};
|
3372
3243
|
|
3373
3244
|
Hash_prototype['$member?'] = Hash_prototype['$has_key?'];
|
3374
3245
|
|
3375
|
-
|
3376
|
-
Hash_prototype.$merge = TMP_48 = function(other) {
|
3246
|
+
Hash_prototype.$merge = TMP_8 = function(other) {
|
3377
3247
|
var __context, block;
|
3378
|
-
block =
|
3248
|
+
block = TMP_8._p || nil, __context = block._s, TMP_8._p = null;
|
3379
3249
|
|
3380
3250
|
|
3381
|
-
var
|
3382
|
-
|
3383
|
-
map2 = result.map;
|
3251
|
+
var keys = this.keys, map = this.map,
|
3252
|
+
result = __hash(), keys2 = result.keys, map2 = result.map;
|
3384
3253
|
|
3385
|
-
for (var
|
3386
|
-
var
|
3254
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3255
|
+
var key = keys[i];
|
3387
3256
|
|
3388
|
-
|
3257
|
+
keys2.push(key);
|
3258
|
+
map2[key] = map[key];
|
3389
3259
|
}
|
3390
3260
|
|
3391
|
-
map = other.map;
|
3261
|
+
var keys = other.keys, map = other.map;
|
3392
3262
|
|
3393
3263
|
if (block === nil) {
|
3394
|
-
for (var
|
3395
|
-
var
|
3264
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3265
|
+
var key = keys[i];
|
3396
3266
|
|
3397
|
-
map2[
|
3267
|
+
if (map2[key] == null) {
|
3268
|
+
keys2.push(key);
|
3269
|
+
}
|
3270
|
+
|
3271
|
+
map2[key] = map[key];
|
3398
3272
|
}
|
3399
3273
|
}
|
3400
3274
|
else {
|
3401
|
-
for (var
|
3402
|
-
var
|
3275
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3276
|
+
var key = keys[i];
|
3403
3277
|
|
3404
|
-
if (
|
3405
|
-
|
3278
|
+
if (map2[key] == null) {
|
3279
|
+
keys2.push(key);
|
3280
|
+
map2[key] = map[key];
|
3281
|
+
}
|
3282
|
+
else {
|
3283
|
+
map2[key] = block.call(__context, key, map2[key], map[key]);
|
3406
3284
|
}
|
3407
|
-
|
3408
|
-
map2[assoc] = [key, val];
|
3409
3285
|
}
|
3410
3286
|
}
|
3411
3287
|
|
@@ -3413,31 +3289,36 @@ Opal.version = "0.3.27";
|
|
3413
3289
|
|
3414
3290
|
};
|
3415
3291
|
|
3416
|
-
|
3417
|
-
Hash_prototype['$merge!'] = TMP_49 = function(other) {
|
3292
|
+
Hash_prototype['$merge!'] = TMP_9 = function(other) {
|
3418
3293
|
var __context, block;
|
3419
|
-
block =
|
3294
|
+
block = TMP_9._p || nil, __context = block._s, TMP_9._p = null;
|
3420
3295
|
|
3421
3296
|
|
3422
|
-
var map
|
3423
|
-
map2 = other.map;
|
3297
|
+
var keys = this.keys, map = this.map,
|
3298
|
+
keys2 = other.keys, map2 = other.map;
|
3424
3299
|
|
3425
3300
|
if (block === nil) {
|
3426
|
-
for (var
|
3427
|
-
var
|
3301
|
+
for (var i = 0, length = keys2.length; i < length; i++) {
|
3302
|
+
var key = keys2[i];
|
3303
|
+
|
3304
|
+
if (map[key] == null) {
|
3305
|
+
keys.push(key);
|
3306
|
+
}
|
3428
3307
|
|
3429
|
-
map[
|
3308
|
+
map[key] = map2[key];
|
3430
3309
|
}
|
3431
3310
|
}
|
3432
3311
|
else {
|
3433
|
-
for (var
|
3434
|
-
var
|
3312
|
+
for (var i = 0, length = keys2.length; i < length; i++) {
|
3313
|
+
var key = keys2[i];
|
3435
3314
|
|
3436
|
-
if (
|
3437
|
-
|
3315
|
+
if (map[key] == null) {
|
3316
|
+
keys.push(key);
|
3317
|
+
map[key] = map2[key];
|
3318
|
+
}
|
3319
|
+
else {
|
3320
|
+
map[key] = block.call(__context, key, map[key], map2[key]);
|
3438
3321
|
}
|
3439
|
-
|
3440
|
-
map[assoc] = [key, val];
|
3441
3322
|
}
|
3442
3323
|
}
|
3443
3324
|
|
@@ -3445,17 +3326,16 @@ Opal.version = "0.3.27";
|
|
3445
3326
|
|
3446
3327
|
};
|
3447
3328
|
|
3448
|
-
// line 2572, (corelib), Hash#rassoc
|
3449
3329
|
Hash_prototype.$rassoc = function(object) {
|
3450
3330
|
|
3451
3331
|
|
3452
|
-
var map = this.map;
|
3332
|
+
var keys = this.keys, map = this.map;
|
3453
3333
|
|
3454
|
-
for (var
|
3455
|
-
var
|
3334
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3335
|
+
var key = keys[i], obj = map[key];
|
3456
3336
|
|
3457
|
-
if ((
|
3458
|
-
return [
|
3337
|
+
if ((obj)['$=='](object)) {
|
3338
|
+
return [key, obj];
|
3459
3339
|
}
|
3460
3340
|
}
|
3461
3341
|
|
@@ -3463,24 +3343,24 @@ Opal.version = "0.3.27";
|
|
3463
3343
|
|
3464
3344
|
};
|
3465
3345
|
|
3466
|
-
|
3467
|
-
Hash_prototype.$reject = TMP_50 = function() {
|
3346
|
+
Hash_prototype.$reject = TMP_10 = function() {
|
3468
3347
|
var __context, block;
|
3469
|
-
block =
|
3348
|
+
block = TMP_10._p || nil, __context = block._s, TMP_10._p = null;
|
3470
3349
|
|
3471
3350
|
|
3472
|
-
var
|
3351
|
+
var keys = this.keys, map = this.map,
|
3352
|
+
result = __hash(), map2 = result.map, keys2 = result.keys;
|
3473
3353
|
|
3474
|
-
for (var
|
3475
|
-
var
|
3476
|
-
value;
|
3354
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3355
|
+
var key = keys[i], obj = map[key], value;
|
3477
3356
|
|
3478
|
-
if ((value = block.call(__context,
|
3357
|
+
if ((value = block.call(__context, key, obj)) === __breaker) {
|
3479
3358
|
return __breaker.$v;
|
3480
3359
|
}
|
3481
3360
|
|
3482
3361
|
if (value === false || value === nil) {
|
3483
|
-
|
3362
|
+
keys2.push(key);
|
3363
|
+
map2[key] = obj;
|
3484
3364
|
}
|
3485
3365
|
}
|
3486
3366
|
|
@@ -3488,40 +3368,39 @@ Opal.version = "0.3.27";
|
|
3488
3368
|
|
3489
3369
|
};
|
3490
3370
|
|
3491
|
-
// line 2609, (corelib), Hash#replace
|
3492
3371
|
Hash_prototype.$replace = function(other) {
|
3493
3372
|
|
3494
3373
|
|
3495
|
-
var map = this.map = {};
|
3496
|
-
|
3497
|
-
for (var assoc in other.map) {
|
3498
|
-
var bucket = other.map[assoc];
|
3374
|
+
var map = this.map = {}, keys = this.keys = [];
|
3499
3375
|
|
3500
|
-
|
3376
|
+
for (var i = 0, length = other.keys.length; i < length; i++) {
|
3377
|
+
var key = other.keys[i];
|
3378
|
+
keys.push(key);
|
3379
|
+
map[key] = other.map[key];
|
3501
3380
|
}
|
3502
3381
|
|
3503
3382
|
return this;
|
3504
3383
|
|
3505
3384
|
};
|
3506
3385
|
|
3507
|
-
|
3508
|
-
Hash_prototype.$select = TMP_51 = function() {
|
3386
|
+
Hash_prototype.$select = TMP_11 = function() {
|
3509
3387
|
var __context, block;
|
3510
|
-
block =
|
3388
|
+
block = TMP_11._p || nil, __context = block._s, TMP_11._p = null;
|
3511
3389
|
|
3512
3390
|
|
3513
|
-
var
|
3391
|
+
var keys = this.keys, map = this.map,
|
3392
|
+
result = __hash(), map2 = result.map, keys2 = result.keys;
|
3514
3393
|
|
3515
|
-
for (var
|
3516
|
-
var
|
3517
|
-
value;
|
3394
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3395
|
+
var key = keys[i], obj = map[key], value;
|
3518
3396
|
|
3519
|
-
if ((value = block.call(__context,
|
3397
|
+
if ((value = block.call(__context, key, obj)) === __breaker) {
|
3520
3398
|
return __breaker.$v;
|
3521
3399
|
}
|
3522
3400
|
|
3523
3401
|
if (value !== false && value !== nil) {
|
3524
|
-
|
3402
|
+
keys2.push(key);
|
3403
|
+
map2[key] = obj;
|
3525
3404
|
}
|
3526
3405
|
}
|
3527
3406
|
|
@@ -3529,25 +3408,27 @@ Opal.version = "0.3.27";
|
|
3529
3408
|
|
3530
3409
|
};
|
3531
3410
|
|
3532
|
-
|
3533
|
-
Hash_prototype['$select!'] = TMP_52 = function() {
|
3411
|
+
Hash_prototype['$select!'] = TMP_12 = function() {
|
3534
3412
|
var __context, block;
|
3535
|
-
block =
|
3413
|
+
block = TMP_12._p || nil, __context = block._s, TMP_12._p = null;
|
3536
3414
|
|
3537
3415
|
|
3538
|
-
var map = this.map, result = nil;
|
3416
|
+
var map = this.map, keys = this.keys, value, result = nil;
|
3539
3417
|
|
3540
|
-
for (var
|
3541
|
-
var
|
3542
|
-
value;
|
3418
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3419
|
+
var key = keys[i], obj = map[key];
|
3543
3420
|
|
3544
|
-
if ((value = block.call(__context,
|
3421
|
+
if ((value = block.call(__context, key, obj)) === __breaker) {
|
3545
3422
|
return __breaker.$v;
|
3546
3423
|
}
|
3547
3424
|
|
3548
3425
|
if (value === false || value === nil) {
|
3549
|
-
|
3550
|
-
|
3426
|
+
keys.splice(i, 1);
|
3427
|
+
delete map[key];
|
3428
|
+
|
3429
|
+
length--;
|
3430
|
+
i--;
|
3431
|
+
result = this
|
3551
3432
|
}
|
3552
3433
|
}
|
3553
3434
|
|
@@ -3555,16 +3436,18 @@ Opal.version = "0.3.27";
|
|
3555
3436
|
|
3556
3437
|
};
|
3557
3438
|
|
3558
|
-
// line 2666, (corelib), Hash#shift
|
3559
3439
|
Hash_prototype.$shift = function() {
|
3560
3440
|
|
3561
3441
|
|
3562
|
-
var map = this.map;
|
3442
|
+
var keys = this.keys, map = this.map;
|
3563
3443
|
|
3564
|
-
|
3565
|
-
var
|
3566
|
-
|
3567
|
-
|
3444
|
+
if (keys.length) {
|
3445
|
+
var key = keys[0], obj = map[key];
|
3446
|
+
|
3447
|
+
delete map[key];
|
3448
|
+
keys.splice(0, 1);
|
3449
|
+
|
3450
|
+
return [key, obj];
|
3568
3451
|
}
|
3569
3452
|
|
3570
3453
|
return nil;
|
@@ -3573,59 +3456,52 @@ Opal.version = "0.3.27";
|
|
3573
3456
|
|
3574
3457
|
Hash_prototype.$size = Hash_prototype.$length;
|
3575
3458
|
|
3576
|
-
// line 2682, (corelib), Hash#to_a
|
3577
3459
|
Hash_prototype.$to_a = function() {
|
3578
3460
|
|
3579
3461
|
|
3580
|
-
var map
|
3581
|
-
result = [];
|
3462
|
+
var keys = this.keys, map = this.map, result = [];
|
3582
3463
|
|
3583
|
-
for (var
|
3584
|
-
var
|
3585
|
-
|
3586
|
-
result.push([bucket[0], bucket[1]]);
|
3464
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3465
|
+
var key = keys[i];
|
3466
|
+
result.push([key, map[key]]);
|
3587
3467
|
}
|
3588
3468
|
|
3589
3469
|
return result;
|
3590
3470
|
|
3591
3471
|
};
|
3592
3472
|
|
3593
|
-
// line 2697, (corelib), Hash#to_hash
|
3594
3473
|
Hash_prototype.$to_hash = function() {
|
3595
3474
|
|
3596
3475
|
return this;
|
3597
3476
|
};
|
3598
3477
|
|
3599
|
-
// line 2701, (corelib), Hash#to_json
|
3600
3478
|
Hash_prototype.$to_json = function() {
|
3601
3479
|
|
3602
3480
|
|
3603
|
-
var
|
3481
|
+
var inspect = [], keys = this.keys, map = this.map;
|
3604
3482
|
|
3605
|
-
for (var
|
3606
|
-
|
3607
|
-
|
3483
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3484
|
+
var key = keys[i];
|
3485
|
+
inspect.push((key).$to_json() + ': ' + (map[key]).$to_json());
|
3608
3486
|
}
|
3609
3487
|
|
3610
|
-
return '{' +
|
3488
|
+
return '{' + inspect.join(', ') + '}';
|
3611
3489
|
|
3612
3490
|
};
|
3613
3491
|
|
3614
|
-
// line 2714, (corelib), Hash#to_native
|
3615
3492
|
Hash_prototype.$to_native = function() {
|
3616
3493
|
|
3617
3494
|
|
3618
|
-
var result = {}, map = this.map, bucket, value;
|
3495
|
+
var result = {}, keys = this.keys, map = this.map, bucket, value;
|
3619
3496
|
|
3620
|
-
for (var
|
3621
|
-
|
3622
|
-
value = bucket[1];
|
3497
|
+
for (var i = 0, length = keys.length; i < length; i++) {
|
3498
|
+
var key = keys[i], obj = map[key];
|
3623
3499
|
|
3624
|
-
if (
|
3625
|
-
result[
|
3500
|
+
if (obj.$to_native) {
|
3501
|
+
result[key] = (obj).$to_native();
|
3626
3502
|
}
|
3627
3503
|
else {
|
3628
|
-
result[
|
3504
|
+
result[key] = obj;
|
3629
3505
|
}
|
3630
3506
|
}
|
3631
3507
|
|
@@ -3637,14 +3513,13 @@ Opal.version = "0.3.27";
|
|
3637
3513
|
|
3638
3514
|
Hash_prototype.$update = Hash_prototype['$merge!'];
|
3639
3515
|
|
3640
|
-
// line 2738, (corelib), Hash#value?
|
3641
3516
|
Hash_prototype['$value?'] = function(value) {
|
3642
3517
|
|
3643
3518
|
|
3644
3519
|
var map = this.map;
|
3645
3520
|
|
3646
3521
|
for (var assoc in map) {
|
3647
|
-
var v = map[assoc]
|
3522
|
+
var v = map[assoc];
|
3648
3523
|
if ((v)['$=='](value)) {
|
3649
3524
|
return true;
|
3650
3525
|
}
|
@@ -3656,45 +3531,47 @@ Opal.version = "0.3.27";
|
|
3656
3531
|
|
3657
3532
|
Hash_prototype.$values_at = Hash_prototype.$indexes;
|
3658
3533
|
|
3659
|
-
// line 2755, (corelib), Hash#values
|
3660
3534
|
Hash_prototype.$values = function() {
|
3661
3535
|
|
3662
3536
|
|
3663
3537
|
var map = this.map,
|
3664
3538
|
result = [];
|
3665
3539
|
|
3666
|
-
for (var
|
3667
|
-
result.push(map[
|
3540
|
+
for (var key in map) {
|
3541
|
+
result.push(map[key]);
|
3668
3542
|
}
|
3669
3543
|
|
3670
3544
|
return result;
|
3671
3545
|
|
3672
3546
|
};
|
3673
|
-
|
3674
|
-
|
3547
|
+
|
3548
|
+
return nil;
|
3549
|
+
})(self, null)
|
3550
|
+
})();
|
3551
|
+
(function() {
|
3552
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass, __gvars = __opal.gvars;
|
3553
|
+
|
3675
3554
|
(function(__base, __super){
|
3676
|
-
// line 2768, (corelib), class String
|
3677
3555
|
function String() {};
|
3678
3556
|
String = __klass(__base, __super, "String", String);
|
3679
|
-
|
3557
|
+
|
3558
|
+
;String._sdonate(["$try_convert", "$new"]); var String_prototype = String.prototype, __scope = String._scope, TMP_1, TMP_2, TMP_3, TMP_4, TMP_5;
|
3680
3559
|
|
3681
3560
|
String_prototype._isString = true;
|
3682
3561
|
|
3683
3562
|
String.$include(__scope.Comparable);
|
3684
3563
|
|
3685
|
-
// line 2773, (corelib), String.try_convert
|
3686
3564
|
String.$try_convert = function(what) {
|
3687
3565
|
|
3688
|
-
|
3689
|
-
what.$to_str()
|
3566
|
+
try {
|
3567
|
+
return what.$to_str()
|
3690
3568
|
} catch ($err) {
|
3691
3569
|
if (true) {
|
3692
3570
|
nil}
|
3693
3571
|
else { throw $err; }
|
3694
|
-
}
|
3572
|
+
}
|
3695
3573
|
};
|
3696
3574
|
|
3697
|
-
// line 2779, (corelib), String.new
|
3698
3575
|
String.$new = function(str) {
|
3699
3576
|
if (str == null) {
|
3700
3577
|
str = ""
|
@@ -3704,7 +3581,6 @@ Opal.version = "0.3.27";
|
|
3704
3581
|
;
|
3705
3582
|
};
|
3706
3583
|
|
3707
|
-
// line 2785, (corelib), String#%
|
3708
3584
|
String_prototype['$%'] = function(data) {
|
3709
3585
|
|
3710
3586
|
|
@@ -3715,7 +3591,6 @@ Opal.version = "0.3.27";
|
|
3715
3591
|
|
3716
3592
|
};
|
3717
3593
|
|
3718
|
-
// line 2794, (corelib), String#*
|
3719
3594
|
String_prototype['$*'] = function(count) {
|
3720
3595
|
|
3721
3596
|
|
@@ -3738,13 +3613,11 @@ Opal.version = "0.3.27";
|
|
3738
3613
|
|
3739
3614
|
};
|
3740
3615
|
|
3741
|
-
// line 2815, (corelib), String#+
|
3742
3616
|
String_prototype['$+'] = function(other) {
|
3743
3617
|
|
3744
3618
|
return this.toString() + other;
|
3745
3619
|
};
|
3746
3620
|
|
3747
|
-
// line 2819, (corelib), String#<=>
|
3748
3621
|
String_prototype['$<=>'] = function(other) {
|
3749
3622
|
|
3750
3623
|
|
@@ -3756,31 +3629,26 @@ Opal.version = "0.3.27";
|
|
3756
3629
|
|
3757
3630
|
};
|
3758
3631
|
|
3759
|
-
// line 2829, (corelib), String#<
|
3760
3632
|
String_prototype['$<'] = function(other) {
|
3761
3633
|
|
3762
3634
|
return this < other;
|
3763
3635
|
};
|
3764
3636
|
|
3765
|
-
// line 2833, (corelib), String#<=
|
3766
3637
|
String_prototype['$<='] = function(other) {
|
3767
3638
|
|
3768
3639
|
return this <= other;
|
3769
3640
|
};
|
3770
3641
|
|
3771
|
-
// line 2837, (corelib), String#>
|
3772
3642
|
String_prototype['$>'] = function(other) {
|
3773
3643
|
|
3774
3644
|
return this > other;
|
3775
3645
|
};
|
3776
3646
|
|
3777
|
-
// line 2841, (corelib), String#>=
|
3778
3647
|
String_prototype['$>='] = function(other) {
|
3779
3648
|
|
3780
3649
|
return this >= other;
|
3781
3650
|
};
|
3782
3651
|
|
3783
|
-
// line 2845, (corelib), String#==
|
3784
3652
|
String_prototype['$=='] = function(other) {
|
3785
3653
|
|
3786
3654
|
return other == String(this);
|
@@ -3788,7 +3656,6 @@ Opal.version = "0.3.27";
|
|
3788
3656
|
|
3789
3657
|
String_prototype['$==='] = String_prototype['$=='];
|
3790
3658
|
|
3791
|
-
// line 2851, (corelib), String#=~
|
3792
3659
|
String_prototype['$=~'] = function(other) {
|
3793
3660
|
|
3794
3661
|
|
@@ -3800,7 +3667,6 @@ Opal.version = "0.3.27";
|
|
3800
3667
|
|
3801
3668
|
};
|
3802
3669
|
|
3803
|
-
// line 2861, (corelib), String#[]
|
3804
3670
|
String_prototype['$[]'] = function(index, length) {
|
3805
3671
|
|
3806
3672
|
|
@@ -3843,13 +3709,11 @@ Opal.version = "0.3.27";
|
|
3843
3709
|
|
3844
3710
|
};
|
3845
3711
|
|
3846
|
-
// line 2902, (corelib), String#capitalize
|
3847
3712
|
String_prototype.$capitalize = function() {
|
3848
3713
|
|
3849
3714
|
return this.charAt(0).toUpperCase() + this.substr(1).toLowerCase();
|
3850
3715
|
};
|
3851
3716
|
|
3852
|
-
// line 2906, (corelib), String#casecmp
|
3853
3717
|
String_prototype.$casecmp = function(other) {
|
3854
3718
|
|
3855
3719
|
|
@@ -3864,10 +3728,9 @@ Opal.version = "0.3.27";
|
|
3864
3728
|
|
3865
3729
|
};
|
3866
3730
|
|
3867
|
-
|
3868
|
-
String_prototype.$chars = TMP_53 = function() {
|
3731
|
+
String_prototype.$chars = TMP_1 = function() {
|
3869
3732
|
var __context, __yield;
|
3870
|
-
__yield =
|
3733
|
+
__yield = TMP_1._p || nil, __context = __yield._s, TMP_1._p = null;
|
3871
3734
|
|
3872
3735
|
|
3873
3736
|
for (var i = 0, length = this.length; i < length; i++) {
|
@@ -3876,7 +3739,6 @@ Opal.version = "0.3.27";
|
|
3876
3739
|
|
3877
3740
|
};
|
3878
3741
|
|
3879
|
-
// line 2927, (corelib), String#chomp
|
3880
3742
|
String_prototype.$chomp = function(separator) {
|
3881
3743
|
if (separator == null) {
|
3882
3744
|
separator = __gvars["/"]
|
@@ -3892,25 +3754,21 @@ Opal.version = "0.3.27";
|
|
3892
3754
|
|
3893
3755
|
};
|
3894
3756
|
|
3895
|
-
// line 2939, (corelib), String#chop
|
3896
3757
|
String_prototype.$chop = function() {
|
3897
3758
|
|
3898
3759
|
return this.substr(0, this.length - 1);
|
3899
3760
|
};
|
3900
3761
|
|
3901
|
-
// line 2943, (corelib), String#chr
|
3902
3762
|
String_prototype.$chr = function() {
|
3903
3763
|
|
3904
3764
|
return this.charAt(0);
|
3905
3765
|
};
|
3906
3766
|
|
3907
|
-
// line 2947, (corelib), String#count
|
3908
3767
|
String_prototype.$count = function(str) {
|
3909
3768
|
|
3910
3769
|
return (this.length - this.replace(new RegExp(str,"g"), '').length) / str.length;
|
3911
3770
|
};
|
3912
3771
|
|
3913
|
-
// line 2951, (corelib), String#demodulize
|
3914
3772
|
String_prototype.$demodulize = function() {
|
3915
3773
|
|
3916
3774
|
|
@@ -3928,10 +3786,9 @@ Opal.version = "0.3.27";
|
|
3928
3786
|
|
3929
3787
|
String_prototype.$each_char = String_prototype.$chars;
|
3930
3788
|
|
3931
|
-
|
3932
|
-
String_prototype.$each_line = TMP_54 = function(separator) {
|
3789
|
+
String_prototype.$each_line = TMP_2 = function(separator) {
|
3933
3790
|
var __context, __yield;
|
3934
|
-
__yield =
|
3791
|
+
__yield = TMP_2._p || nil, __context = __yield._s, TMP_2._p = null;
|
3935
3792
|
if (separator == null) {
|
3936
3793
|
separator = __gvars["/"]
|
3937
3794
|
}
|
@@ -3944,13 +3801,11 @@ Opal.version = "0.3.27";
|
|
3944
3801
|
|
3945
3802
|
};
|
3946
3803
|
|
3947
|
-
// line 2977, (corelib), String#empty?
|
3948
3804
|
String_prototype['$empty?'] = function() {
|
3949
3805
|
|
3950
3806
|
return this.length === 0;
|
3951
3807
|
};
|
3952
3808
|
|
3953
|
-
// line 2981, (corelib), String#end_with?
|
3954
3809
|
String_prototype['$end_with?'] = function(suffixes) {
|
3955
3810
|
suffixes = __slice.call(arguments, 0);
|
3956
3811
|
|
@@ -3968,7 +3823,6 @@ Opal.version = "0.3.27";
|
|
3968
3823
|
|
3969
3824
|
String_prototype['$eql?'] = String_prototype['$=='];
|
3970
3825
|
|
3971
|
-
// line 2997, (corelib), String#equal?
|
3972
3826
|
String_prototype['$equal?'] = function(val) {
|
3973
3827
|
|
3974
3828
|
return this.toString() === val.toString();
|
@@ -3976,10 +3830,9 @@ Opal.version = "0.3.27";
|
|
3976
3830
|
|
3977
3831
|
String_prototype.$getbyte = String_prototype.charCodeAt;
|
3978
3832
|
|
3979
|
-
|
3980
|
-
String_prototype.$gsub = TMP_55 = function(pattern, replace) {
|
3833
|
+
String_prototype.$gsub = TMP_3 = function(pattern, replace) {
|
3981
3834
|
var __a, __context, block;
|
3982
|
-
block =
|
3835
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
3983
3836
|
|
3984
3837
|
if ((__a = pattern['$is_a?'](__scope.String)) !== false && __a !== nil) {
|
3985
3838
|
pattern = (new RegExp("" + __scope.Regexp.$escape(pattern)))
|
@@ -3995,19 +3848,16 @@ Opal.version = "0.3.27";
|
|
3995
3848
|
|
3996
3849
|
String_prototype.$hash = String_prototype.toString;
|
3997
3850
|
|
3998
|
-
// line 3019, (corelib), String#hex
|
3999
3851
|
String_prototype.$hex = function() {
|
4000
3852
|
|
4001
3853
|
return this.$to_i(16);
|
4002
3854
|
};
|
4003
3855
|
|
4004
|
-
// line 3023, (corelib), String#include?
|
4005
3856
|
String_prototype['$include?'] = function(other) {
|
4006
3857
|
|
4007
3858
|
return this.indexOf(other) !== -1;
|
4008
3859
|
};
|
4009
3860
|
|
4010
|
-
// line 3027, (corelib), String#index
|
4011
3861
|
String_prototype.$index = function(what, offset) {
|
4012
3862
|
var __a;
|
4013
3863
|
|
@@ -4046,7 +3896,6 @@ Opal.version = "0.3.27";
|
|
4046
3896
|
|
4047
3897
|
};
|
4048
3898
|
|
4049
|
-
// line 3064, (corelib), String#inspect
|
4050
3899
|
String_prototype.$inspect = function() {
|
4051
3900
|
|
4052
3901
|
|
@@ -4072,7 +3921,6 @@ Opal.version = "0.3.27";
|
|
4072
3921
|
|
4073
3922
|
};
|
4074
3923
|
|
4075
|
-
// line 3088, (corelib), String#intern
|
4076
3924
|
String_prototype.$intern = function() {
|
4077
3925
|
|
4078
3926
|
return this;
|
@@ -4080,13 +3928,11 @@ Opal.version = "0.3.27";
|
|
4080
3928
|
|
4081
3929
|
String_prototype.$lines = String_prototype.$each_line;
|
4082
3930
|
|
4083
|
-
// line 3094, (corelib), String#length
|
4084
3931
|
String_prototype.$length = function() {
|
4085
3932
|
|
4086
3933
|
return this.length;
|
4087
3934
|
};
|
4088
3935
|
|
4089
|
-
// line 3098, (corelib), String#ljust
|
4090
3936
|
String_prototype.$ljust = function(integer, padstr) {
|
4091
3937
|
if (padstr == null) {
|
4092
3938
|
padstr = " "
|
@@ -4094,16 +3940,14 @@ Opal.version = "0.3.27";
|
|
4094
3940
|
return this.$raise(__scope.NotImplementedError);
|
4095
3941
|
};
|
4096
3942
|
|
4097
|
-
// line 3102, (corelib), String#lstrip
|
4098
3943
|
String_prototype.$lstrip = function() {
|
4099
3944
|
|
4100
3945
|
return this.replace(/^\s*/, '');
|
4101
3946
|
};
|
4102
3947
|
|
4103
|
-
|
4104
|
-
String_prototype.$match = TMP_56 = function(pattern, pos) {
|
3948
|
+
String_prototype.$match = TMP_4 = function(pattern, pos) {
|
4105
3949
|
var __a, __b, __context, block;
|
4106
|
-
block =
|
3950
|
+
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
4107
3951
|
|
4108
3952
|
return (__a = (function() { if ((__b = pattern['$is_a?'](__scope.Regexp)) !== false && __b !== nil) {
|
4109
3953
|
return pattern
|
@@ -4112,7 +3956,6 @@ Opal.version = "0.3.27";
|
|
4112
3956
|
}; return nil; }).call(this), __a.$match._p = block.$to_proc(), __a.$match(this, pos));
|
4113
3957
|
};
|
4114
3958
|
|
4115
|
-
// line 3110, (corelib), String#next
|
4116
3959
|
String_prototype.$next = function() {
|
4117
3960
|
|
4118
3961
|
|
@@ -4127,13 +3970,11 @@ Opal.version = "0.3.27";
|
|
4127
3970
|
|
4128
3971
|
};
|
4129
3972
|
|
4130
|
-
// line 3123, (corelib), String#ord
|
4131
3973
|
String_prototype.$ord = function() {
|
4132
3974
|
|
4133
3975
|
return this.charCodeAt(0);
|
4134
3976
|
};
|
4135
3977
|
|
4136
|
-
// line 3127, (corelib), String#partition
|
4137
3978
|
String_prototype.$partition = function(str) {
|
4138
3979
|
|
4139
3980
|
|
@@ -4144,13 +3985,11 @@ Opal.version = "0.3.27";
|
|
4144
3985
|
|
4145
3986
|
};
|
4146
3987
|
|
4147
|
-
// line 3136, (corelib), String#reverse
|
4148
3988
|
String_prototype.$reverse = function() {
|
4149
3989
|
|
4150
3990
|
return this.split('').reverse().join('');
|
4151
3991
|
};
|
4152
3992
|
|
4153
|
-
// line 3140, (corelib), String#rstrip
|
4154
3993
|
String_prototype.$rstrip = function() {
|
4155
3994
|
|
4156
3995
|
return this.replace(/\s*$/, '');
|
@@ -4160,7 +3999,6 @@ Opal.version = "0.3.27";
|
|
4160
3999
|
|
4161
4000
|
String_prototype.$slice = String_prototype['$[]'];
|
4162
4001
|
|
4163
|
-
// line 3148, (corelib), String#split
|
4164
4002
|
String_prototype.$split = function(pattern, limit) {
|
4165
4003
|
var __a;if (pattern == null) {
|
4166
4004
|
pattern = ((__a = __gvars[";"]), __a !== false && __a !== nil ? __a : " ")
|
@@ -4168,7 +4006,6 @@ Opal.version = "0.3.27";
|
|
4168
4006
|
return this.split(pattern, limit);
|
4169
4007
|
};
|
4170
4008
|
|
4171
|
-
// line 3152, (corelib), String#start_with?
|
4172
4009
|
String_prototype['$start_with?'] = function(prefixes) {
|
4173
4010
|
prefixes = __slice.call(arguments, 0);
|
4174
4011
|
|
@@ -4182,16 +4019,14 @@ Opal.version = "0.3.27";
|
|
4182
4019
|
|
4183
4020
|
};
|
4184
4021
|
|
4185
|
-
// line 3164, (corelib), String#strip
|
4186
4022
|
String_prototype.$strip = function() {
|
4187
4023
|
|
4188
4024
|
return this.replace(/^\s*/, '').replace(/\s*$/, '');
|
4189
4025
|
};
|
4190
4026
|
|
4191
|
-
|
4192
|
-
String_prototype.$sub = TMP_57 = function(pattern, replace) {
|
4027
|
+
String_prototype.$sub = TMP_5 = function(pattern, replace) {
|
4193
4028
|
var __context, block;
|
4194
|
-
block =
|
4029
|
+
block = TMP_5._p || nil, __context = block._s, TMP_5._p = null;
|
4195
4030
|
|
4196
4031
|
|
4197
4032
|
if (typeof(replace) === 'string') {
|
@@ -4229,7 +4064,6 @@ Opal.version = "0.3.27";
|
|
4229
4064
|
|
4230
4065
|
String_prototype.$succ = String_prototype.$next;
|
4231
4066
|
|
4232
|
-
// line 3205, (corelib), String#sum
|
4233
4067
|
String_prototype.$sum = function(n) {
|
4234
4068
|
if (n == null) {
|
4235
4069
|
n = 16
|
@@ -4245,7 +4079,6 @@ Opal.version = "0.3.27";
|
|
4245
4079
|
|
4246
4080
|
};
|
4247
4081
|
|
4248
|
-
// line 3217, (corelib), String#swapcase
|
4249
4082
|
String_prototype.$swapcase = function() {
|
4250
4083
|
|
4251
4084
|
|
@@ -4261,7 +4094,6 @@ Opal.version = "0.3.27";
|
|
4261
4094
|
|
4262
4095
|
};
|
4263
4096
|
|
4264
|
-
// line 3231, (corelib), String#to_a
|
4265
4097
|
String_prototype.$to_a = function() {
|
4266
4098
|
|
4267
4099
|
|
@@ -4273,7 +4105,6 @@ Opal.version = "0.3.27";
|
|
4273
4105
|
|
4274
4106
|
};
|
4275
4107
|
|
4276
|
-
// line 3241, (corelib), String#to_f
|
4277
4108
|
String_prototype.$to_f = function() {
|
4278
4109
|
|
4279
4110
|
|
@@ -4283,7 +4114,6 @@ Opal.version = "0.3.27";
|
|
4283
4114
|
|
4284
4115
|
};
|
4285
4116
|
|
4286
|
-
// line 3249, (corelib), String#to_i
|
4287
4117
|
String_prototype.$to_i = function(base) {
|
4288
4118
|
if (base == null) {
|
4289
4119
|
base = 10
|
@@ -4301,7 +4131,6 @@ Opal.version = "0.3.27";
|
|
4301
4131
|
|
4302
4132
|
String_prototype.$to_json = String_prototype.$inspect;
|
4303
4133
|
|
4304
|
-
// line 3263, (corelib), String#to_proc
|
4305
4134
|
String_prototype.$to_proc = function() {
|
4306
4135
|
|
4307
4136
|
|
@@ -4317,7 +4146,6 @@ Opal.version = "0.3.27";
|
|
4317
4146
|
|
4318
4147
|
String_prototype.$to_sym = String_prototype.$intern;
|
4319
4148
|
|
4320
|
-
// line 3277, (corelib), String#underscore
|
4321
4149
|
String_prototype.$underscore = function() {
|
4322
4150
|
|
4323
4151
|
return this.replace(/[-\s]+/g, '_')
|
@@ -4326,15 +4154,18 @@ Opal.version = "0.3.27";
|
|
4326
4154
|
.toLowerCase();
|
4327
4155
|
};
|
4328
4156
|
|
4329
|
-
String_prototype.$upcase = String_prototype.toUpperCase;
|
4330
|
-
;String._sdonate(["$try_convert", "$new"]);
|
4157
|
+
return String_prototype.$upcase = String_prototype.toUpperCase;
|
4331
4158
|
})(self, String);
|
4332
|
-
__scope.Symbol = __scope.String;
|
4159
|
+
return __scope.Symbol = __scope.String;
|
4160
|
+
})();
|
4161
|
+
(function() {
|
4162
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
4163
|
+
|
4333
4164
|
(function(__base, __super){
|
4334
|
-
// line 3288, (corelib), class Numeric
|
4335
4165
|
function Numeric() {};
|
4336
4166
|
Numeric = __klass(__base, __super, "Numeric", Numeric);
|
4337
|
-
|
4167
|
+
|
4168
|
+
var Numeric_prototype = Numeric.prototype, __scope = Numeric._scope, TMP_1, TMP_2, TMP_3;
|
4338
4169
|
|
4339
4170
|
|
4340
4171
|
Numeric_prototype._isNumber = true;
|
@@ -4342,121 +4173,101 @@ Opal.version = "0.3.27";
|
|
4342
4173
|
|
4343
4174
|
Numeric.$include(__scope.Comparable);
|
4344
4175
|
|
4345
|
-
// line 3295, (corelib), Numeric#+
|
4346
4176
|
Numeric_prototype['$+'] = function(other) {
|
4347
4177
|
|
4348
4178
|
return this + other;
|
4349
4179
|
};
|
4350
4180
|
|
4351
|
-
// line 3299, (corelib), Numeric#-
|
4352
4181
|
Numeric_prototype['$-'] = function(other) {
|
4353
4182
|
|
4354
4183
|
return this - other;
|
4355
4184
|
};
|
4356
4185
|
|
4357
|
-
// line 3303, (corelib), Numeric#*
|
4358
4186
|
Numeric_prototype['$*'] = function(other) {
|
4359
4187
|
|
4360
4188
|
return this * other;
|
4361
4189
|
};
|
4362
4190
|
|
4363
|
-
// line 3307, (corelib), Numeric#/
|
4364
4191
|
Numeric_prototype['$/'] = function(other) {
|
4365
4192
|
|
4366
4193
|
return this / other;
|
4367
4194
|
};
|
4368
4195
|
|
4369
|
-
// line 3311, (corelib), Numeric#%
|
4370
4196
|
Numeric_prototype['$%'] = function(other) {
|
4371
4197
|
|
4372
4198
|
return this % other;
|
4373
4199
|
};
|
4374
4200
|
|
4375
|
-
// line 3315, (corelib), Numeric#&
|
4376
4201
|
Numeric_prototype['$&'] = function(other) {
|
4377
4202
|
|
4378
4203
|
return this & other;
|
4379
4204
|
};
|
4380
4205
|
|
4381
|
-
// line 3319, (corelib), Numeric#|
|
4382
4206
|
Numeric_prototype['$|'] = function(other) {
|
4383
4207
|
|
4384
4208
|
return this | other;
|
4385
4209
|
};
|
4386
4210
|
|
4387
|
-
// line 3323, (corelib), Numeric#^
|
4388
4211
|
Numeric_prototype['$^'] = function(other) {
|
4389
4212
|
|
4390
4213
|
return this ^ other;
|
4391
4214
|
};
|
4392
4215
|
|
4393
|
-
// line 3327, (corelib), Numeric#<
|
4394
4216
|
Numeric_prototype['$<'] = function(other) {
|
4395
4217
|
|
4396
4218
|
return this < other;
|
4397
4219
|
};
|
4398
4220
|
|
4399
|
-
// line 3331, (corelib), Numeric#<=
|
4400
4221
|
Numeric_prototype['$<='] = function(other) {
|
4401
4222
|
|
4402
4223
|
return this <= other;
|
4403
4224
|
};
|
4404
4225
|
|
4405
|
-
// line 3335, (corelib), Numeric#>
|
4406
4226
|
Numeric_prototype['$>'] = function(other) {
|
4407
4227
|
|
4408
4228
|
return this > other;
|
4409
4229
|
};
|
4410
4230
|
|
4411
|
-
// line 3339, (corelib), Numeric#>=
|
4412
4231
|
Numeric_prototype['$>='] = function(other) {
|
4413
4232
|
|
4414
4233
|
return this >= other;
|
4415
4234
|
};
|
4416
4235
|
|
4417
|
-
// line 3343, (corelib), Numeric#<<
|
4418
4236
|
Numeric_prototype['$<<'] = function(count) {
|
4419
4237
|
|
4420
4238
|
return this << count;
|
4421
4239
|
};
|
4422
4240
|
|
4423
|
-
// line 3347, (corelib), Numeric#>>
|
4424
4241
|
Numeric_prototype['$>>'] = function(count) {
|
4425
4242
|
|
4426
4243
|
return this >> count;
|
4427
4244
|
};
|
4428
4245
|
|
4429
|
-
// line 3351, (corelib), Numeric#+@
|
4430
4246
|
Numeric_prototype['$+@'] = function() {
|
4431
4247
|
|
4432
4248
|
return +this;
|
4433
4249
|
};
|
4434
4250
|
|
4435
|
-
// line 3355, (corelib), Numeric#-@
|
4436
4251
|
Numeric_prototype['$-@'] = function() {
|
4437
4252
|
|
4438
4253
|
return -this;
|
4439
4254
|
};
|
4440
4255
|
|
4441
|
-
// line 3359, (corelib), Numeric#~
|
4442
4256
|
Numeric_prototype['$~'] = function() {
|
4443
4257
|
|
4444
4258
|
return ~this;
|
4445
4259
|
};
|
4446
4260
|
|
4447
|
-
// line 3363, (corelib), Numeric#**
|
4448
4261
|
Numeric_prototype['$**'] = function(other) {
|
4449
4262
|
|
4450
4263
|
return Math.pow(this, other);
|
4451
4264
|
};
|
4452
4265
|
|
4453
|
-
// line 3367, (corelib), Numeric#==
|
4454
4266
|
Numeric_prototype['$=='] = function(other) {
|
4455
4267
|
|
4456
4268
|
return this == other;
|
4457
4269
|
};
|
4458
4270
|
|
4459
|
-
// line 3371, (corelib), Numeric#<=>
|
4460
4271
|
Numeric_prototype['$<=>'] = function(other) {
|
4461
4272
|
|
4462
4273
|
|
@@ -4468,28 +4279,24 @@ Opal.version = "0.3.27";
|
|
4468
4279
|
|
4469
4280
|
};
|
4470
4281
|
|
4471
|
-
// line 3381, (corelib), Numeric#abs
|
4472
4282
|
Numeric_prototype.$abs = function() {
|
4473
4283
|
|
4474
4284
|
return Math.abs(this);
|
4475
4285
|
};
|
4476
4286
|
|
4477
|
-
// line 3385, (corelib), Numeric#ceil
|
4478
4287
|
Numeric_prototype.$ceil = function() {
|
4479
4288
|
|
4480
4289
|
return Math.ceil(this);
|
4481
4290
|
};
|
4482
4291
|
|
4483
|
-
// line 3389, (corelib), Numeric#chr
|
4484
4292
|
Numeric_prototype.$chr = function() {
|
4485
4293
|
|
4486
4294
|
return String.fromCharCode(this);
|
4487
4295
|
};
|
4488
4296
|
|
4489
|
-
|
4490
|
-
Numeric_prototype.$downto = TMP_58 = function(finish) {
|
4297
|
+
Numeric_prototype.$downto = TMP_1 = function(finish) {
|
4491
4298
|
var __context, block;
|
4492
|
-
block =
|
4299
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
4493
4300
|
|
4494
4301
|
|
4495
4302
|
for (var i = this; i >= finish; i--) {
|
@@ -4504,25 +4311,21 @@ Opal.version = "0.3.27";
|
|
4504
4311
|
|
4505
4312
|
Numeric_prototype['$eql?'] = Numeric_prototype['$=='];
|
4506
4313
|
|
4507
|
-
// line 3407, (corelib), Numeric#even?
|
4508
4314
|
Numeric_prototype['$even?'] = function() {
|
4509
4315
|
|
4510
4316
|
return this % 2 === 0;
|
4511
4317
|
};
|
4512
4318
|
|
4513
|
-
// line 3411, (corelib), Numeric#floor
|
4514
4319
|
Numeric_prototype.$floor = function() {
|
4515
4320
|
|
4516
4321
|
return Math.floor(this);
|
4517
4322
|
};
|
4518
4323
|
|
4519
|
-
// line 3415, (corelib), Numeric#hash
|
4520
4324
|
Numeric_prototype.$hash = function() {
|
4521
4325
|
|
4522
4326
|
return this.toString();
|
4523
4327
|
};
|
4524
4328
|
|
4525
|
-
// line 3419, (corelib), Numeric#integer?
|
4526
4329
|
Numeric_prototype['$integer?'] = function() {
|
4527
4330
|
|
4528
4331
|
return this % 1 === 0;
|
@@ -4532,31 +4335,26 @@ Opal.version = "0.3.27";
|
|
4532
4335
|
|
4533
4336
|
Numeric_prototype.$modulo = Numeric_prototype['$%'];
|
4534
4337
|
|
4535
|
-
// line 3427, (corelib), Numeric#next
|
4536
4338
|
Numeric_prototype.$next = function() {
|
4537
4339
|
|
4538
4340
|
return this + 1;
|
4539
4341
|
};
|
4540
4342
|
|
4541
|
-
// line 3431, (corelib), Numeric#nonzero?
|
4542
4343
|
Numeric_prototype['$nonzero?'] = function() {
|
4543
4344
|
|
4544
4345
|
return this === 0 ? nil : this;
|
4545
4346
|
};
|
4546
4347
|
|
4547
|
-
// line 3435, (corelib), Numeric#odd?
|
4548
4348
|
Numeric_prototype['$odd?'] = function() {
|
4549
4349
|
|
4550
4350
|
return this % 2 !== 0;
|
4551
4351
|
};
|
4552
4352
|
|
4553
|
-
// line 3439, (corelib), Numeric#ord
|
4554
4353
|
Numeric_prototype.$ord = function() {
|
4555
4354
|
|
4556
4355
|
return this;
|
4557
4356
|
};
|
4558
4357
|
|
4559
|
-
// line 3443, (corelib), Numeric#pred
|
4560
4358
|
Numeric_prototype.$pred = function() {
|
4561
4359
|
|
4562
4360
|
return this - 1;
|
@@ -4564,13 +4362,12 @@ Opal.version = "0.3.27";
|
|
4564
4362
|
|
4565
4363
|
Numeric_prototype.$succ = Numeric_prototype.$next;
|
4566
4364
|
|
4567
|
-
|
4568
|
-
Numeric_prototype.$times = TMP_59 = function() {
|
4365
|
+
Numeric_prototype.$times = TMP_2 = function() {
|
4569
4366
|
var __context, block;
|
4570
|
-
block =
|
4367
|
+
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
4571
4368
|
|
4572
4369
|
|
4573
|
-
for (var i = 0; i
|
4370
|
+
for (var i = 0; i < this; i++) {
|
4574
4371
|
if (block.call(__context, i) === __breaker) {
|
4575
4372
|
return __breaker.$v;
|
4576
4373
|
}
|
@@ -4580,25 +4377,21 @@ Opal.version = "0.3.27";
|
|
4580
4377
|
|
4581
4378
|
};
|
4582
4379
|
|
4583
|
-
// line 3461, (corelib), Numeric#to_f
|
4584
4380
|
Numeric_prototype.$to_f = function() {
|
4585
4381
|
|
4586
4382
|
return parseFloat(this);
|
4587
4383
|
};
|
4588
4384
|
|
4589
|
-
// line 3465, (corelib), Numeric#to_i
|
4590
4385
|
Numeric_prototype.$to_i = function() {
|
4591
4386
|
|
4592
4387
|
return parseInt(this);
|
4593
4388
|
};
|
4594
4389
|
|
4595
|
-
// line 3469, (corelib), Numeric#to_json
|
4596
4390
|
Numeric_prototype.$to_json = function() {
|
4597
4391
|
|
4598
4392
|
return this.toString();
|
4599
4393
|
};
|
4600
4394
|
|
4601
|
-
// line 3473, (corelib), Numeric#to_s
|
4602
4395
|
Numeric_prototype.$to_s = function(base) {
|
4603
4396
|
if (base == null) {
|
4604
4397
|
base = 10
|
@@ -4606,13 +4399,12 @@ Opal.version = "0.3.27";
|
|
4606
4399
|
return this.toString();
|
4607
4400
|
};
|
4608
4401
|
|
4609
|
-
|
4610
|
-
Numeric_prototype.$upto = TMP_60 = function(finish) {
|
4402
|
+
Numeric_prototype.$upto = TMP_3 = function(finish) {
|
4611
4403
|
var __context, block;
|
4612
|
-
block =
|
4404
|
+
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
4613
4405
|
|
4614
4406
|
|
4615
|
-
for (var i =
|
4407
|
+
for (var i = this; i <= finish; i++) {
|
4616
4408
|
if (block.call(__context, i) === __breaker) {
|
4617
4409
|
return __breaker.$v;
|
4618
4410
|
}
|
@@ -4622,65 +4414,69 @@ Opal.version = "0.3.27";
|
|
4622
4414
|
|
4623
4415
|
};
|
4624
4416
|
|
4625
|
-
// line 3489, (corelib), Numeric#zero?
|
4626
4417
|
Numeric_prototype['$zero?'] = function() {
|
4627
4418
|
|
4628
4419
|
return this == 0;
|
4629
4420
|
};
|
4630
4421
|
|
4422
|
+
return nil;
|
4631
4423
|
})(self, Number);
|
4632
|
-
__scope.Fixnum = __scope.Numeric;
|
4633
|
-
|
4634
|
-
|
4424
|
+
return __scope.Fixnum = __scope.Numeric;
|
4425
|
+
})();
|
4426
|
+
(function() {
|
4427
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
4428
|
+
|
4429
|
+
return (function(__base, __super){
|
4635
4430
|
function Proc() {};
|
4636
4431
|
Proc = __klass(__base, __super, "Proc", Proc);
|
4637
|
-
|
4432
|
+
|
4433
|
+
;Proc._sdonate(["$new"]); var Proc_prototype = Proc.prototype, __scope = Proc._scope, TMP_1;
|
4638
4434
|
|
4639
4435
|
|
4640
4436
|
Proc_prototype._isProc = true;
|
4641
4437
|
Proc_prototype.is_lambda = true;
|
4642
4438
|
|
4643
4439
|
|
4644
|
-
|
4645
|
-
Proc.$new = TMP_61 = function() {
|
4440
|
+
Proc.$new = TMP_1 = function() {
|
4646
4441
|
var __context, block;
|
4647
|
-
block =
|
4442
|
+
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
4648
4443
|
|
4649
4444
|
if (block === nil) no_block_given();
|
4650
4445
|
block.is_lambda = false;
|
4651
4446
|
return block;
|
4652
4447
|
};
|
4653
4448
|
|
4654
|
-
// line 3507, (corelib), Proc#call
|
4655
4449
|
Proc_prototype.$call = function(args) {
|
4656
4450
|
args = __slice.call(arguments, 0);
|
4657
4451
|
return this.apply(this._s, args);
|
4658
4452
|
};
|
4659
4453
|
|
4660
|
-
// line 3511, (corelib), Proc#to_proc
|
4661
4454
|
Proc_prototype.$to_proc = function() {
|
4662
4455
|
|
4663
4456
|
return this;
|
4664
4457
|
};
|
4665
4458
|
|
4666
|
-
// line 3515, (corelib), Proc#lambda?
|
4667
4459
|
Proc_prototype['$lambda?'] = function() {
|
4668
4460
|
|
4669
4461
|
return !!this.is_lambda;
|
4670
4462
|
};
|
4671
4463
|
|
4672
|
-
// line 3521, (corelib), Proc#arity
|
4673
4464
|
Proc_prototype.$arity = function() {
|
4674
4465
|
|
4675
4466
|
return this.length - 1;
|
4676
4467
|
};
|
4677
|
-
|
4678
|
-
|
4679
|
-
(
|
4680
|
-
|
4468
|
+
|
4469
|
+
return nil;
|
4470
|
+
})(self, Function)
|
4471
|
+
})();
|
4472
|
+
(function() {
|
4473
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
4474
|
+
|
4475
|
+
return (function(__base, __super){
|
4681
4476
|
function Range() {};
|
4682
4477
|
Range = __klass(__base, __super, "Range", Range);
|
4683
|
-
|
4478
|
+
|
4479
|
+
var Range_prototype = Range.prototype, __scope = Range._scope, TMP_1;
|
4684
4480
|
Range_prototype.begin = Range_prototype.end = nil;
|
4685
4481
|
|
4686
4482
|
Range.$include(__scope.Enumerable);
|
@@ -4698,19 +4494,16 @@ Opal.version = "0.3.27";
|
|
4698
4494
|
};
|
4699
4495
|
|
4700
4496
|
|
4701
|
-
// line 3541, (corelib), Range#begin
|
4702
4497
|
Range_prototype.$begin = function() {
|
4703
4498
|
|
4704
4499
|
return this.begin
|
4705
|
-
};
|
4500
|
+
}, nil;
|
4706
4501
|
|
4707
|
-
// line 3542, (corelib), Range#end
|
4708
4502
|
Range_prototype.$end = function() {
|
4709
4503
|
|
4710
4504
|
return this.end
|
4711
|
-
};
|
4505
|
+
}, nil;
|
4712
4506
|
|
4713
|
-
// line 3544, (corelib), Range#initialize
|
4714
4507
|
Range_prototype.$initialize = function(min, max, exclude) {
|
4715
4508
|
if (exclude == null) {
|
4716
4509
|
exclude = false
|
@@ -4720,7 +4513,6 @@ Opal.version = "0.3.27";
|
|
4720
4513
|
return this.exclude = exclude;
|
4721
4514
|
};
|
4722
4515
|
|
4723
|
-
// line 3550, (corelib), Range#==
|
4724
4516
|
Range_prototype['$=='] = function(other) {
|
4725
4517
|
|
4726
4518
|
|
@@ -4732,13 +4524,11 @@ Opal.version = "0.3.27";
|
|
4732
4524
|
|
4733
4525
|
};
|
4734
4526
|
|
4735
|
-
// line 3561, (corelib), Range#===
|
4736
4527
|
Range_prototype['$==='] = function(obj) {
|
4737
4528
|
|
4738
4529
|
return obj >= this.begin && (this.exclude ? obj < this.end : obj <= this.end);
|
4739
4530
|
};
|
4740
4531
|
|
4741
|
-
// line 3565, (corelib), Range#cover?
|
4742
4532
|
Range_prototype['$cover?'] = function(value) {
|
4743
4533
|
var __a, __b, __c;
|
4744
4534
|
return ((__a = (this.begin)['$<='](value)) ? value['$<=']((function() { if ((__b = this['$exclude_end?']()) !== false && __b !== nil) {
|
@@ -4748,13 +4538,12 @@ Opal.version = "0.3.27";
|
|
4748
4538
|
}; return nil; }).call(this)) : __a);
|
4749
4539
|
};
|
4750
4540
|
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
__yield = TMP_62._p || nil, __context = __yield._s, TMP_62._p = null;
|
4541
|
+
Range_prototype.$each = TMP_1 = function() {
|
4542
|
+
var current = nil, __a, __b, __c, __context, __yield;
|
4543
|
+
__yield = TMP_1._p || nil, __context = __yield._s, TMP_1._p = null;
|
4755
4544
|
|
4756
4545
|
current = this.$min();
|
4757
|
-
while ((__b =
|
4546
|
+
while ((__b = (__c = current['$=='](this.$max()), (__c === nil || __c === false))) !== false && __b !== nil){if (__yield.call(__context, current) === __breaker) return __breaker.$v;
|
4758
4547
|
current = current.$succ();};
|
4759
4548
|
if ((__a = this['$exclude_end?']()) === false || __a === nil) {
|
4760
4549
|
if (__yield.call(__context, current) === __breaker) return __breaker.$v
|
@@ -4762,7 +4551,6 @@ Opal.version = "0.3.27";
|
|
4762
4551
|
return this;
|
4763
4552
|
};
|
4764
4553
|
|
4765
|
-
// line 3583, (corelib), Range#eql?
|
4766
4554
|
Range_prototype['$eql?'] = function(other) {
|
4767
4555
|
var __a;
|
4768
4556
|
if ((__a = __scope.Range['$==='](other)) === false || __a === nil) {
|
@@ -4771,13 +4559,11 @@ Opal.version = "0.3.27";
|
|
4771
4559
|
return (__a = ((__a = this['$exclude_end?']()['$=='](other['$exclude_end?']())) ? (this.begin)['$eql?'](other.$begin()) : __a), __a !== false && __a !== nil ? (this.end)['$eql?'](other.$end()) : __a);
|
4772
4560
|
};
|
4773
4561
|
|
4774
|
-
// line 3589, (corelib), Range#exclude_end?
|
4775
4562
|
Range_prototype['$exclude_end?'] = function() {
|
4776
4563
|
|
4777
4564
|
return this.exclude;
|
4778
4565
|
};
|
4779
4566
|
|
4780
|
-
// line 3594, (corelib), Range#include?
|
4781
4567
|
Range_prototype['$include?'] = function(val) {
|
4782
4568
|
|
4783
4569
|
return obj >= this.begin && obj <= this.end;
|
@@ -4789,7 +4575,6 @@ Opal.version = "0.3.27";
|
|
4789
4575
|
|
4790
4576
|
Range_prototype['$member?'] = Range_prototype['$include?'];
|
4791
4577
|
|
4792
|
-
// line 3604, (corelib), Range#step
|
4793
4578
|
Range_prototype.$step = function(n) {
|
4794
4579
|
if (n == null) {
|
4795
4580
|
n = 1
|
@@ -4797,24 +4582,25 @@ Opal.version = "0.3.27";
|
|
4797
4582
|
return this.$raise(__scope.NotImplementedError);
|
4798
4583
|
};
|
4799
4584
|
|
4800
|
-
// line 3608, (corelib), Range#to_s
|
4801
4585
|
Range_prototype.$to_s = function() {
|
4802
4586
|
|
4803
4587
|
return this.begin + (this.exclude ? '...' : '..') + this.end;
|
4804
4588
|
};
|
4805
4589
|
|
4806
|
-
Range_prototype.$inspect = Range_prototype.$to_s;
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4590
|
+
return Range_prototype.$inspect = Range_prototype.$to_s;
|
4591
|
+
})(self, null)
|
4592
|
+
})();
|
4593
|
+
(function() {
|
4594
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
4595
|
+
|
4596
|
+
return (function(__base, __super){
|
4811
4597
|
function Time() {};
|
4812
4598
|
Time = __klass(__base, __super, "Time", Time);
|
4813
|
-
|
4599
|
+
|
4600
|
+
;Time._sdonate(["$at", "$new", "$now"]); var Time_prototype = Time.prototype, __scope = Time._scope;
|
4814
4601
|
|
4815
4602
|
Time.$include(__scope.Comparable);
|
4816
4603
|
|
4817
|
-
// line 3617, (corelib), Time.at
|
4818
4604
|
Time.$at = function(seconds, frac) {
|
4819
4605
|
if (frac == null) {
|
4820
4606
|
frac = 0
|
@@ -4822,7 +4608,6 @@ Opal.version = "0.3.27";
|
|
4822
4608
|
return new Date(seconds * 1000 + frac);
|
4823
4609
|
};
|
4824
4610
|
|
4825
|
-
// line 3621, (corelib), Time.new
|
4826
4611
|
Time.$new = function(year, month, day, hour, minute, second, millisecond) {
|
4827
4612
|
|
4828
4613
|
|
@@ -4847,25 +4632,21 @@ Opal.version = "0.3.27";
|
|
4847
4632
|
|
4848
4633
|
};
|
4849
4634
|
|
4850
|
-
// line 3644, (corelib), Time.now
|
4851
4635
|
Time.$now = function() {
|
4852
4636
|
|
4853
4637
|
return new Date();
|
4854
4638
|
};
|
4855
4639
|
|
4856
|
-
// line 3648, (corelib), Time#+
|
4857
4640
|
Time_prototype['$+'] = function(other) {
|
4858
4641
|
var __a, __b;
|
4859
4642
|
return __scope.Time.$allocate((__a = this.$to_f(), __b = other.$to_f(), typeof(__a) === 'number' ? __a + __b : __a['$+'](__b)));
|
4860
4643
|
};
|
4861
4644
|
|
4862
|
-
// line 3652, (corelib), Time#-
|
4863
4645
|
Time_prototype['$-'] = function(other) {
|
4864
4646
|
var __a, __b;
|
4865
4647
|
return __scope.Time.$allocate((__a = this.$to_f(), __b = other.$to_f(), typeof(__a) === 'number' ? __a - __b : __a['$-'](__b)));
|
4866
4648
|
};
|
4867
4649
|
|
4868
|
-
// line 3656, (corelib), Time#<=>
|
4869
4650
|
Time_prototype['$<=>'] = function(other) {
|
4870
4651
|
|
4871
4652
|
return this.$to_f()['$<=>'](other.$to_f());
|
@@ -4873,13 +4654,11 @@ Opal.version = "0.3.27";
|
|
4873
4654
|
|
4874
4655
|
Time_prototype.$day = Time_prototype.getDate;
|
4875
4656
|
|
4876
|
-
// line 3662, (corelib), Time#eql?
|
4877
4657
|
Time_prototype['$eql?'] = function(other) {
|
4878
4658
|
var __a;
|
4879
4659
|
return (__a = other['$is_a?'](__scope.Time), __a !== false && __a !== nil ? this['$<=>'](other)['$zero?']() : __a);
|
4880
4660
|
};
|
4881
4661
|
|
4882
|
-
// line 3666, (corelib), Time#friday?
|
4883
4662
|
Time_prototype['$friday?'] = function() {
|
4884
4663
|
|
4885
4664
|
return this.getDay() === 5;
|
@@ -4891,13 +4670,11 @@ Opal.version = "0.3.27";
|
|
4891
4670
|
|
4892
4671
|
Time_prototype.$min = Time_prototype.getMinutes;
|
4893
4672
|
|
4894
|
-
// line 3676, (corelib), Time#mon
|
4895
4673
|
Time_prototype.$mon = function() {
|
4896
4674
|
|
4897
4675
|
return this.getMonth() + 1;
|
4898
4676
|
};
|
4899
4677
|
|
4900
|
-
// line 3680, (corelib), Time#monday?
|
4901
4678
|
Time_prototype['$monday?'] = function() {
|
4902
4679
|
|
4903
4680
|
return this.getDay() === 1;
|
@@ -4905,7 +4682,6 @@ Opal.version = "0.3.27";
|
|
4905
4682
|
|
4906
4683
|
Time_prototype.$month = Time_prototype.$mon;
|
4907
4684
|
|
4908
|
-
// line 3686, (corelib), Time#saturday?
|
4909
4685
|
Time_prototype['$saturday?'] = function() {
|
4910
4686
|
|
4911
4687
|
return this.getDay() === 6;
|
@@ -4913,31 +4689,26 @@ Opal.version = "0.3.27";
|
|
4913
4689
|
|
4914
4690
|
Time_prototype.$sec = Time_prototype.getSeconds;
|
4915
4691
|
|
4916
|
-
// line 3692, (corelib), Time#sunday?
|
4917
4692
|
Time_prototype['$sunday?'] = function() {
|
4918
4693
|
|
4919
4694
|
return this.getDay() === 0;
|
4920
4695
|
};
|
4921
4696
|
|
4922
|
-
// line 3696, (corelib), Time#thursday?
|
4923
4697
|
Time_prototype['$thursday?'] = function() {
|
4924
4698
|
|
4925
4699
|
return this.getDay() === 4;
|
4926
4700
|
};
|
4927
4701
|
|
4928
|
-
// line 3700, (corelib), Time#to_f
|
4929
4702
|
Time_prototype.$to_f = function() {
|
4930
4703
|
|
4931
4704
|
return this.getTime() / 1000;
|
4932
4705
|
};
|
4933
4706
|
|
4934
|
-
// line 3704, (corelib), Time#to_i
|
4935
4707
|
Time_prototype.$to_i = function() {
|
4936
4708
|
|
4937
4709
|
return parseInt(this.getTime() / 1000);
|
4938
4710
|
};
|
4939
4711
|
|
4940
|
-
// line 3708, (corelib), Time#tuesday?
|
4941
4712
|
Time_prototype['$tuesday?'] = function() {
|
4942
4713
|
|
4943
4714
|
return this.getDay() === 2;
|
@@ -4945,29 +4716,28 @@ Opal.version = "0.3.27";
|
|
4945
4716
|
|
4946
4717
|
Time_prototype.$wday = Time_prototype.getDay;
|
4947
4718
|
|
4948
|
-
// line 3714, (corelib), Time#wednesday?
|
4949
4719
|
Time_prototype['$wednesday?'] = function() {
|
4950
4720
|
|
4951
4721
|
return this.getDay() === 3;
|
4952
4722
|
};
|
4953
4723
|
|
4954
|
-
Time_prototype.$year = Time_prototype.getFullYear;
|
4955
|
-
|
4956
|
-
|
4724
|
+
return Time_prototype.$year = Time_prototype.getFullYear;
|
4725
|
+
})(self, Date)
|
4726
|
+
})();
|
4727
|
+
(function() {
|
4728
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module, __hash2 = __opal.hash2;
|
4729
|
+
|
4957
4730
|
var json_parse = JSON.parse;
|
4958
|
-
(function(__base){
|
4959
|
-
// line 3722, (corelib), module JSON
|
4731
|
+
return (function(__base){
|
4960
4732
|
function JSON() {};
|
4961
4733
|
JSON = __module(__base, "JSON", JSON);
|
4962
4734
|
var JSON_prototype = JSON.prototype, __scope = JSON._scope;
|
4963
4735
|
|
4964
|
-
// line 3723, (corelib), JSON.parse
|
4965
4736
|
JSON.$parse = function(source) {
|
4966
4737
|
|
4967
4738
|
return to_opal(json_parse(source));
|
4968
4739
|
};
|
4969
4740
|
|
4970
|
-
// line 3728, (corelib), JSON.from_object
|
4971
4741
|
JSON.$from_object = function(js_object) {
|
4972
4742
|
|
4973
4743
|
return to_opal(js_object);
|
@@ -5001,12 +4771,13 @@ Opal.version = "0.3.27";
|
|
5001
4771
|
return arr;
|
5002
4772
|
}
|
5003
4773
|
else {
|
5004
|
-
var hash =
|
4774
|
+
var hash = __hash2([], {}), v, map = hash.map, keys = hash.keys;
|
5005
4775
|
|
5006
4776
|
for (var k in value) {
|
5007
4777
|
if (__hasOwn.call(value, k)) {
|
5008
4778
|
v = to_opal(value[k]);
|
5009
|
-
|
4779
|
+
keys.push(k);
|
4780
|
+
map[k] = v;
|
5010
4781
|
}
|
5011
4782
|
}
|
5012
4783
|
}
|
@@ -5017,16 +4788,19 @@ Opal.version = "0.3.27";
|
|
5017
4788
|
|
5018
4789
|
;JSON._sdonate(["$parse", "$from_object"]);
|
5019
4790
|
})(self);
|
4791
|
+
})();
|
4792
|
+
(function() {
|
4793
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass, __hash2 = __opal.hash2;
|
4794
|
+
|
5020
4795
|
return (function(__base, __super){
|
5021
|
-
// line 3775, (corelib), class Template
|
5022
4796
|
function Template() {};
|
5023
4797
|
Template = __klass(__base, __super, "Template", Template);
|
5024
|
-
|
4798
|
+
|
4799
|
+
;Template._sdonate(["$[]", "$[]="]); var Template_prototype = Template.prototype, __scope = Template._scope, TMP_1;
|
5025
4800
|
Template_prototype.body = nil;
|
5026
4801
|
|
5027
|
-
Template._cache =
|
4802
|
+
Template._cache = __hash2([], {});
|
5028
4803
|
|
5029
|
-
// line 3777, (corelib), Template.[]
|
5030
4804
|
Template['$[]'] = function(name) {
|
5031
4805
|
|
5032
4806
|
if (this._cache == null) this._cache = nil;
|
@@ -5034,7 +4808,6 @@ Opal.version = "0.3.27";
|
|
5034
4808
|
return this._cache['$[]'](name)
|
5035
4809
|
};
|
5036
4810
|
|
5037
|
-
// line 3781, (corelib), Template.[]=
|
5038
4811
|
Template['$[]='] = function(name, instance) {
|
5039
4812
|
|
5040
4813
|
if (this._cache == null) this._cache = nil;
|
@@ -5042,24 +4815,23 @@ Opal.version = "0.3.27";
|
|
5042
4815
|
return this._cache['$[]='](name, instance)
|
5043
4816
|
};
|
5044
4817
|
|
5045
|
-
|
5046
|
-
Template_prototype.$initialize = TMP_63 = function(name) {
|
4818
|
+
Template_prototype.$initialize = TMP_1 = function(name) {
|
5047
4819
|
var __context, body;
|
5048
|
-
body =
|
4820
|
+
body = TMP_1._p || nil, __context = body._s, TMP_1._p = null;
|
5049
4821
|
|
5050
4822
|
this.body = body;
|
5051
4823
|
this.name = name;
|
5052
4824
|
return __scope.Template['$[]='](name, this);
|
5053
4825
|
};
|
5054
4826
|
|
5055
|
-
// line 3791, (corelib), Template#render
|
5056
4827
|
Template_prototype.$render = function(ctx) {
|
5057
4828
|
var __a;if (ctx == null) {
|
5058
4829
|
ctx = this
|
5059
4830
|
}
|
5060
4831
|
return (__a = ctx, __a.$instance_eval._p = this.body.$to_proc(), __a.$instance_eval());
|
5061
4832
|
};
|
5062
|
-
|
5063
|
-
|
4833
|
+
|
4834
|
+
return nil;
|
4835
|
+
})(self, null)
|
5064
4836
|
})();
|
5065
4837
|
}).call(this);
|