object_memspec.rb 390 B

1234567891011121314
  1. require 'spec_helper'
  2. describe V8::C::Object do
  3. include V8::MemSpec
  4. it "will return a new peer and not barf if the old peer has been garbage collected" do
  5. v8_eval('var o = {foo: "bar"}')
  6. old_id = v8_eval('o').object_id
  7. ruby_gc do
  8. v8_eval('o').Get(c::String::New("foo")).Utf8Value().should == "bar"
  9. v8_eval('o').object_id.should_not be(old_id)
  10. end
  11. end
  12. end