1
0
Fork 0
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:
Sam 2016-09-22 10:15:53 +10:00
parent 7f3df01960
commit 767814af4e

10
test/test_crash.rb Normal file
View 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');")