Sha256: 279235413865178873fc46e72375cda08e32acb09974982eb87f467663e9e755

Contents?: true

Size: 428 Bytes

Versions: 4

Compression:

Stored size: 428 Bytes

Contents

class TestHash
  if $RUBYJS
    def hash
      `var el = {}; el["1"] = null; return el`
    end
  else
    def hash
      {"1" => nil}
    end
  end

  def test
    h = {"a" => 6, "b" => 7, "1" => 1, 1 => 2, "1,2" => "hello", [1,2] => "good"} 
    p h["a"]
    p h["b"] 
    p h["1"]
    p h[1]
    p h["1,2"]
    p h[[1,2]] 

    puts "test native JS hash"
    a = hash()
    #p a
  end

  def self.main
    new.test
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
superchris-rubyjs-0.8.2 test/test_hash.rb
rubyjs-0.7.0 test/test_hash.rb
rubyjs-0.8.0 test/test_hash.rb
rubyjs-0.7.1 test/test_hash.rb