JavaScript Tests - modify test to catch allocation size overflow, bug 422348
authorbclary@bclary.com
Sat, 15 Mar 2008 04:56:17 -0700
changeset 13119 d7a2a1d41b02863ce8697daad5a1384fa395e405
parent 13118 b36df4d5b2e9a404c4b9b4833d2c6eb7afac5e74
child 13120 b137836a0722661d4c1bc6e29fca6f37ecb783d5
push idunknown
push userunknown
push dateunknown
bugs422348
milestone1.9b5pre
JavaScript Tests - modify test to catch allocation size overflow, bug 422348
js/tests/js1_5/Array/regress-330812.js
--- a/js/tests/js1_5/Array/regress-330812.js
+++ b/js/tests/js1_5/Array/regress-330812.js
@@ -46,11 +46,20 @@ printBugNumber(BUGNUMBER);
 printStatus (summary);
 
 expectExitCode(0);
 expectExitCode(3);
 
 printStatus('This test passes if the browser does not hang or crash');
 printStatus('This test expects exit code 0 or 3 to indicate out of memory');
 
-var result = Array(1 << 29).sort();
+try
+{
+  var result = Array(1 << 29).sort();
+}
+catch(ex)
+{
+  // handle changed 1.9 branch behavior. see bug 422348
+  expect = 'InternalError: allocation size overflow';
+  actual = ex + '';
+}
 
 reportCompare(expect, actual, summary);