Skip to content
Permalink
Browse files

Merge pull request #513 from jstepien/array-const

Array.[] passes the spec
  • Loading branch information
timfel committed Mar 16, 2013
2 parents f862db1 + 59bb996 commit 2efbbe57cb764968666338a45812f656f62f4f9d
Showing with 4 additions and 6 deletions.
  1. +4 −0 lib-topaz/array.rb
  2. +0 −2 spec/tags/core/array/constructor_tags.txt
  3. +0 −4 topaz/objects/arrayobject.py
@@ -25,6 +25,10 @@ def initialize(size_or_arr = nil, obj = nil, &block)
return self
end

def self.[](*args)
args.inject(allocate) { |array, arg| array << arg}
end

def inspect
result = "["
recursion = Thread.current.recursion_guard(self) do

This file was deleted.

@@ -49,10 +49,6 @@ def listview(self, space):
def singleton_method_allocate(self, space, args_w):
return W_ArrayObject(space, [], self)

@classdef.singleton_method("[]")
def singleton_method_subscript(self, space, args_w):
return space.newarray(args_w)

@classdef.method("initialize_copy", other_w="array")
@classdef.method("replace", other_w="array")
@check_frozen()

0 comments on commit 2efbbe5

Please sign in to comment.
You can’t perform that action at this time.