File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed
Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 8484 is present (` a = 0; a [0] ` parses as a deference on a).
8585
8686* Fix various ` Struct ` methods. Fixed ` #each ` and ` #each_pair ` to return
87- self.
87+ self. Add ` Struct.[] ` as synonym for ` Struct.new ` .
8888
8989## 0.5.5 2013-11-25
9090
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ def self.inherited(klass)
4949 }
5050 end
5151
52+ class << self
53+ alias [] new
54+ end
55+
5256 include Enumerable
5357
5458 def initialize ( *args )
Original file line number Diff line number Diff line change 11opal_filter "Struct" do
2+ fails "Struct#[] fails when it does not know about the requested attribute"
3+ fails "Struct#[] fails if not passed a string, symbol, or integer"
4+
25 fails "Struct#initialize can be overriden"
6+
37 fails "Struct.new fails with too many arguments"
48 fails "Struct.new creates a constant in subclass' namespace"
59 fails "Struct.new raises a TypeError if object is not a Symbol"
Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ core/symbol/to_proc_spec
319319
320320core/struct/each_pair_spec
321321core/struct/each_spec
322+ core/struct/element_reference_spec
322323core/struct/initialize_spec
323324core/struct/new_spec
324325
You can’t perform that action at this time.
0 commit comments