Sha256: 88251e44d3a31147a268edd0cce0d15564030df9a1e574681c17d03e46a6822a

Contents?: true

Size: 468 Bytes

Versions: 3

Compression:

Stored size: 468 Bytes

Contents

class TestArray
  if $RUBYJS
    def array
      [1, 2, `null`, [`null`, `null`, 4]]
    end
  else
    def array
      [1, 2, nil, [nil, nil, 4]]
    end
  end

  def test
    # delete
    a = [ "a", "b", "b", "b", "c" ]
    p a.delete("b")                   #=> "b"
    p a                               #=> ["a", "c"]
    p a.delete("z")                   #=> nil

    puts "test native JS array mapping"
    p array()
  end

  def self.main
    new.test
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubyjs-0.7.1 test/test_array.rb
rubyjs-0.8.0 test/test_array.rb
rubyjs-0.7.0 test/test_array.rb