| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1753 v8::FunctionTemplate::New(ThrowFromC)); | 1753 v8::FunctionTemplate::New(ThrowFromC)); |
| 1754 LocalContext context(0, templ); | 1754 LocalContext context(0, templ); |
| 1755 v8::TryCatch try_catch; | 1755 v8::TryCatch try_catch; |
| 1756 CompileRun("ThrowFromC();"); | 1756 CompileRun("ThrowFromC();"); |
| 1757 CHECK(try_catch.HasCaught()); | 1757 CHECK(try_catch.HasCaught()); |
| 1758 } | 1758 } |
| 1759 | 1759 |
| 1760 | 1760 |
| 1761 // Test that a try-finally block doesn't shadow a try-catch block | 1761 // Test that a try-finally block doesn't shadow a try-catch block |
| 1762 // when setting up an external handler. | 1762 // when setting up an external handler. |
| 1763 THREADED_TEST(TryCatchInTryFinally) { | 1763 // |
| 1764 // TODO(271): This should be a threaded test. It was disabled for the |
| 1765 // thread tests because it fails on the ARM simulator. Should be made |
| 1766 // threadable again when the simulator issue is resolved. |
| 1767 TEST(TryCatchInTryFinally) { |
| 1764 v8::HandleScope scope; | 1768 v8::HandleScope scope; |
| 1765 Local<ObjectTemplate> templ = ObjectTemplate::New(); | 1769 Local<ObjectTemplate> templ = ObjectTemplate::New(); |
| 1766 templ->Set(v8_str("CCatcher"), | 1770 templ->Set(v8_str("CCatcher"), |
| 1767 v8::FunctionTemplate::New(CCatcher)); | 1771 v8::FunctionTemplate::New(CCatcher)); |
| 1768 LocalContext context(0, templ); | 1772 LocalContext context(0, templ); |
| 1769 Local<Value> result = CompileRun("try {" | 1773 Local<Value> result = CompileRun("try {" |
| 1770 " try {" | 1774 " try {" |
| 1771 " CCatcher('throw 7;');" | 1775 " CCatcher('throw 7;');" |
| 1772 " } finally {" | 1776 " } finally {" |
| 1773 " }" | 1777 " }" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 // no other activations do. The right activation is always the topmost one with | 1910 // no other activations do. The right activation is always the topmost one with |
| 1907 // a handler, regardless of whether it is in JavaScript or C. | 1911 // a handler, regardless of whether it is in JavaScript or C. |
| 1908 // | 1912 // |
| 1909 // The notation used to describe a test case looks like this: | 1913 // The notation used to describe a test case looks like this: |
| 1910 // | 1914 // |
| 1911 // *JS[4] *C[3] @JS[2] C[1] JS[0] | 1915 // *JS[4] *C[3] @JS[2] C[1] JS[0] |
| 1912 // | 1916 // |
| 1913 // Each entry is an activation, either JS or C. The index is the count at that | 1917 // Each entry is an activation, either JS or C. The index is the count at that |
| 1914 // level. Stars identify activations with exception handlers, the @ identifies | 1918 // level. Stars identify activations with exception handlers, the @ identifies |
| 1915 // the exception handler that should catch the exception. | 1919 // the exception handler that should catch the exception. |
| 1916 THREADED_TEST(ExceptionOrder) { | 1920 // |
| 1921 // TODO(271): This should be a threaded test. It was disabled for the |
| 1922 // thread tests because it fails on the ARM simulator. Should be made |
| 1923 // threadable again when the simulator issue is resolved. |
| 1924 TEST(ExceptionOrder) { |
| 1917 v8::HandleScope scope; | 1925 v8::HandleScope scope; |
| 1918 Local<ObjectTemplate> templ = ObjectTemplate::New(); | 1926 Local<ObjectTemplate> templ = ObjectTemplate::New(); |
| 1919 templ->Set(v8_str("check"), v8::FunctionTemplate::New(JSCheck)); | 1927 templ->Set(v8_str("check"), v8::FunctionTemplate::New(JSCheck)); |
| 1920 templ->Set(v8_str("CThrowCountDown"), | 1928 templ->Set(v8_str("CThrowCountDown"), |
| 1921 v8::FunctionTemplate::New(CThrowCountDown)); | 1929 v8::FunctionTemplate::New(CThrowCountDown)); |
| 1922 LocalContext context(0, templ); | 1930 LocalContext context(0, templ); |
| 1923 CompileRun( | 1931 CompileRun( |
| 1924 "function JSThrowCountDown(count, jsInterval, cInterval, expected) {" | 1932 "function JSThrowCountDown(count, jsInterval, cInterval, expected) {" |
| 1925 " if (count == 0) throw 'FromJS';" | 1933 " if (count == 0) throw 'FromJS';" |
| 1926 " if (count % jsInterval == 0) {" | 1934 " if (count % jsInterval == 0) {" |
| (...skipping 3868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5795 | 5803 |
| 5796 // Local context should still be live. | 5804 // Local context should still be live. |
| 5797 CHECK(!local_env.IsEmpty()); | 5805 CHECK(!local_env.IsEmpty()); |
| 5798 local_env->Enter(); | 5806 local_env->Enter(); |
| 5799 | 5807 |
| 5800 // Should complete without problems. | 5808 // Should complete without problems. |
| 5801 RegExpInterruptTest().RunTest(); | 5809 RegExpInterruptTest().RunTest(); |
| 5802 | 5810 |
| 5803 local_env->Exit(); | 5811 local_env->Exit(); |
| 5804 } | 5812 } |
| OLD | NEW |