1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
if (typeof oomAfterAllocations !== 'function') quit(); function first(a) { return a[0]; } try { first([function() {}]); first([function() {}]); oomAfterAllocations(50); first([function() {}]); } catch(e) { // ignore oom }