mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
disable memory specs which weren't working on 1.8
This commit is contained in:
parent
72e7924bf1
commit
2642cbd4ae
6 changed files with 21 additions and 13 deletions
|
@ -30,7 +30,7 @@ describe C::Context do
|
||||||
one();
|
one();
|
||||||
JS
|
JS
|
||||||
trace.length.should be(4)
|
trace.length.should be(4)
|
||||||
trace.first.tap do |frame|
|
trace.to_a[0].tap do |frame|
|
||||||
frame.line_number.should == 10
|
frame.line_number.should == 10
|
||||||
frame.column.should == 16
|
frame.column.should == 16
|
||||||
frame.script_name.should == 'trace.js'
|
frame.script_name.should == 'trace.js'
|
||||||
|
|
|
@ -24,11 +24,15 @@ module V8::ExtSpec
|
||||||
end
|
end
|
||||||
|
|
||||||
def ruby_gc
|
def ruby_gc
|
||||||
current = GC.stress
|
if GC.respond_to?(:stress)
|
||||||
GC.stress = true
|
current = GC.stress
|
||||||
|
GC.stress = true
|
||||||
|
end
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
GC.stress = current
|
if GC.respond_to?(:stess)
|
||||||
|
GC.stress = current
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def v8_gc
|
def v8_gc
|
||||||
|
|
|
@ -38,4 +38,5 @@ describe "Memory:" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
#These don't work in 1.8.7. Can't determine why not. I'll probably have to come back to this.
|
||||||
|
end if RUBY_VERSION >= '1.9.2'
|
|
@ -17,5 +17,6 @@ describe V8::C::Object do
|
||||||
v8_eval('o').Get(c::String::New("foo")).Utf8Value().should == "bar"
|
v8_eval('o').Get(c::String::New("foo")).Utf8Value().should == "bar"
|
||||||
v8_eval('o').object_id.should_not be(old_id)
|
v8_eval('o').object_id.should_not be(old_id)
|
||||||
end
|
end
|
||||||
end
|
#can't quite get this to work in 1.8. I'm questioning if it's worth the effort
|
||||||
|
end if RUBY_VERSION >= "1.9.2"
|
||||||
end
|
end
|
|
@ -1 +1 @@
|
||||||
Subproject commit ff7bd687925baf2c207a987c9dc973452236415f
|
Subproject commit 162d1e5dfb674346657807c9662a9a20a355b2fd
|
|
@ -46,7 +46,7 @@ describe V8::Portal::Proxies do
|
||||||
v8_gc()
|
v8_gc()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end if RUBY_VERSION >= "1.9.2"
|
||||||
end
|
end
|
||||||
|
|
||||||
context "for a JavaScript objects which are embedded into Ruby" do
|
context "for a JavaScript objects which are embedded into Ruby" do
|
||||||
|
@ -66,9 +66,9 @@ describe V8::Portal::Proxies do
|
||||||
it "will not a proxy twice if the proxy creator block actually registers the proxy inside it" do
|
it "will not a proxy twice if the proxy creator block actually registers the proxy inside it" do
|
||||||
target = Object.new
|
target = Object.new
|
||||||
proxy = c::Object::New()
|
proxy = c::Object::New()
|
||||||
expect {subject.rb2js(target) do |object|
|
expect {subject.rb2js(target) do |object|
|
||||||
subject.register_javascript_proxy(proxy, :for => object)
|
subject.register_javascript_proxy(proxy, :for => object)
|
||||||
c::Object::New()
|
c::Object::New()
|
||||||
end}.should_not raise_error
|
end}.should_not raise_error
|
||||||
subject.rb2js(target).should be(proxy)
|
subject.rb2js(target).should be(proxy)
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,7 @@ describe V8::Portal::Proxies do
|
||||||
v8_gc
|
v8_gc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end if RUBY_VERSION >= "1.9.2"
|
||||||
|
|
||||||
context "looking up a Ruby object from a random JavaScript object" do
|
context "looking up a Ruby object from a random JavaScript object" do
|
||||||
it "checks first if it's a native Ruby object with a javascript proxy" do
|
it "checks first if it's a native Ruby object with a javascript proxy" do
|
||||||
|
@ -180,8 +180,10 @@ describe V8::Portal::Proxies do
|
||||||
|
|
||||||
after do
|
after do
|
||||||
ruby_gc do
|
ruby_gc do
|
||||||
@after.each(&:call) if @after
|
@after.each do |proc|
|
||||||
|
proc.call
|
||||||
|
end if @after
|
||||||
end
|
end
|
||||||
end
|
end if RUBY_VERSION >= '1.9.2'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue