| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2656 v8::TryCatch try_catch; | 2656 v8::TryCatch try_catch; |
| 2657 try_catch.SetVerbose(true); | 2657 try_catch.SetVerbose(true); |
| 2658 Local<Value> result = CompileRun("ThrowFromC();"); | 2658 Local<Value> result = CompileRun("ThrowFromC();"); |
| 2659 CHECK(try_catch.HasCaught()); | 2659 CHECK(try_catch.HasCaught()); |
| 2660 CHECK(result.IsEmpty()); | 2660 CHECK(result.IsEmpty()); |
| 2661 CHECK(message_received); | 2661 CHECK(message_received); |
| 2662 v8::V8::RemoveMessageListeners(check_message); | 2662 v8::V8::RemoveMessageListeners(check_message); |
| 2663 } | 2663 } |
| 2664 | 2664 |
| 2665 | 2665 |
| 2666 TEST(APIStackOverflowAndVerboseTryCatch) { |
| 2667 message_received = false; |
| 2668 v8::HandleScope scope; |
| 2669 v8::V8::AddMessageListener(receive_message); |
| 2670 LocalContext context; |
| 2671 v8::TryCatch try_catch; |
| 2672 try_catch.SetVerbose(true); |
| 2673 Local<Value> result = CompileRun("function foo() { foo(); } foo();"); |
| 2674 CHECK(try_catch.HasCaught()); |
| 2675 CHECK(result.IsEmpty()); |
| 2676 CHECK(message_received); |
| 2677 v8::V8::RemoveMessageListeners(receive_message); |
| 2678 } |
| 2679 |
| 2680 |
| 2666 THREADED_TEST(ExternalScriptException) { | 2681 THREADED_TEST(ExternalScriptException) { |
| 2667 v8::HandleScope scope; | 2682 v8::HandleScope scope; |
| 2668 Local<ObjectTemplate> templ = ObjectTemplate::New(); | 2683 Local<ObjectTemplate> templ = ObjectTemplate::New(); |
| 2669 templ->Set(v8_str("ThrowFromC"), | 2684 templ->Set(v8_str("ThrowFromC"), |
| 2670 v8::FunctionTemplate::New(ThrowFromC)); | 2685 v8::FunctionTemplate::New(ThrowFromC)); |
| 2671 LocalContext context(0, templ); | 2686 LocalContext context(0, templ); |
| 2672 | 2687 |
| 2673 v8::TryCatch try_catch; | 2688 v8::TryCatch try_catch; |
| 2674 Local<Script> script | 2689 Local<Script> script |
| 2675 = Script::Compile(v8_str("ThrowFromC(); throw 'panama';")); | 2690 = Script::Compile(v8_str("ThrowFromC(); throw 'panama';")); |
| (...skipping 11208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13884 CHECK(func2->CreationContext() == context2); | 13899 CHECK(func2->CreationContext() == context2); |
| 13885 CheckContextId(func2, 2); | 13900 CheckContextId(func2, 2); |
| 13886 CHECK(instance2->CreationContext() == context2); | 13901 CHECK(instance2->CreationContext() == context2); |
| 13887 CheckContextId(instance2, 2); | 13902 CheckContextId(instance2, 2); |
| 13888 } | 13903 } |
| 13889 | 13904 |
| 13890 context1.Dispose(); | 13905 context1.Dispose(); |
| 13891 context2.Dispose(); | 13906 context2.Dispose(); |
| 13892 context3.Dispose(); | 13907 context3.Dispose(); |
| 13893 } | 13908 } |
| OLD | NEW |