Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: test/cctest/test-api.cc

Issue 6816021: Report stack overflow exceptions to V8 message listeners (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/top.cc ('K') | « src/top.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 v8::TryCatch try_catch; 2648 v8::TryCatch try_catch;
2649 try_catch.SetVerbose(true); 2649 try_catch.SetVerbose(true);
2650 Local<Value> result = CompileRun("ThrowFromC();"); 2650 Local<Value> result = CompileRun("ThrowFromC();");
2651 CHECK(try_catch.HasCaught()); 2651 CHECK(try_catch.HasCaught());
2652 CHECK(result.IsEmpty()); 2652 CHECK(result.IsEmpty());
2653 CHECK(message_received); 2653 CHECK(message_received);
2654 v8::V8::RemoveMessageListeners(check_message); 2654 v8::V8::RemoveMessageListeners(check_message);
2655 } 2655 }
2656 2656
2657 2657
2658 TEST(APIStackOverflowAndVerboseTryCatch) {
2659 message_received = false;
2660 v8::HandleScope scope;
2661 v8::V8::AddMessageListener(receive_message);
2662 LocalContext context;
2663 v8::TryCatch try_catch;
2664 try_catch.SetVerbose(true);
2665 Local<Value> result = CompileRun("function foo() { foo(); } foo();");
2666 CHECK(try_catch.HasCaught());
2667 CHECK(result.IsEmpty());
2668 CHECK(message_received);
2669 v8::V8::RemoveMessageListeners(receive_message);
2670 }
2671
2672
2658 THREADED_TEST(ExternalScriptException) { 2673 THREADED_TEST(ExternalScriptException) {
2659 v8::HandleScope scope; 2674 v8::HandleScope scope;
2660 Local<ObjectTemplate> templ = ObjectTemplate::New(); 2675 Local<ObjectTemplate> templ = ObjectTemplate::New();
2661 templ->Set(v8_str("ThrowFromC"), 2676 templ->Set(v8_str("ThrowFromC"),
2662 v8::FunctionTemplate::New(ThrowFromC)); 2677 v8::FunctionTemplate::New(ThrowFromC));
2663 LocalContext context(0, templ); 2678 LocalContext context(0, templ);
2664 2679
2665 v8::TryCatch try_catch; 2680 v8::TryCatch try_catch;
2666 Local<Script> script 2681 Local<Script> script
2667 = Script::Compile(v8_str("ThrowFromC(); throw 'panama';")); 2682 = Script::Compile(v8_str("ThrowFromC(); throw 'panama';"));
(...skipping 11086 matching lines...) Expand 10 before | Expand all | Expand 10 after
13754 CHECK(func2->CreationContext() == context2); 13769 CHECK(func2->CreationContext() == context2);
13755 CheckContextId(func2, 2); 13770 CheckContextId(func2, 2);
13756 CHECK(instance2->CreationContext() == context2); 13771 CHECK(instance2->CreationContext() == context2);
13757 CheckContextId(instance2, 2); 13772 CheckContextId(instance2, 2);
13758 } 13773 }
13759 13774
13760 context1.Dispose(); 13775 context1.Dispose();
13761 context2.Dispose(); 13776 context2.Dispose();
13762 context3.Dispose(); 13777 context3.Dispose();
13763 } 13778 }
OLDNEW
« src/top.cc ('K') | « src/top.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698