mirror of
https://github.com/rubyjs/mini_racer
synced 2023-03-27 23:21:28 -04:00
add test for VM crash
This commit is contained in:
parent
7f3df01960
commit
767814af4e
1 changed files with 10 additions and 0 deletions
10
test/test_crash.rb
Normal file
10
test/test_crash.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
||||
require 'mini_racer'
|
||||
|
||||
context = MiniRacer::Context.new(timeout: 10)
|
||||
context.attach("echo", proc{|msg| GC.start; p msg; msg})
|
||||
GC.disable
|
||||
100.times { 'foo' } # alloc a handful of objects
|
||||
GC.enable
|
||||
|
||||
context.eval("while(true) echo('foo');")
|
Loading…
Reference in a new issue