| description('Test that if an arrity check causes a stack overflow, the exception goes to the right catch'); |
| function funcWith20Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, |
| arg9, arg10, arg11, arg12, arg13, arg14, arg15, |
| arg16, arg17, arg18, arg19, arg20) |
| debug("ERROR: Shouldn't arrive in 20 arg function!"); |
| var gotRightCatch = false, gotWrongCatch1 = false, gotWrongCatch2 = false; |
| // Should get here because of stack overflow, |
| // now cause a stack overflow exception due to arrity processing |
| var dummy = new RegExp('a|b|c'); |
| // Should get here because of stack overflow, |
| // now cause a stack overflow exception due to arrity processing |
| funcWith20Args(1, 2, 3, 4, 5, 6); |
| shouldBeTrue("gotRightCatch"); |
| shouldBeFalse("gotWrongCatch1"); |
| shouldBeFalse("gotWrongCatch2"); |