OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 17206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17217 | 17217 |
17218 CHECK(stackTrace->AsArray()->IsArray()); | 17218 CHECK(stackTrace->AsArray()->IsArray()); |
17219 } else if (testGroup == kDetailedTest) { | 17219 } else if (testGroup == kDetailedTest) { |
17220 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( | 17220 v8::Handle<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( |
17221 args.GetIsolate(), 10, v8::StackTrace::kDetailed); | 17221 args.GetIsolate(), 10, v8::StackTrace::kDetailed); |
17222 CHECK_EQ(4, stackTrace->GetFrameCount()); | 17222 CHECK_EQ(4, stackTrace->GetFrameCount()); |
17223 checkStackFrame(origin, "bat", 4, 22, false, false, | 17223 checkStackFrame(origin, "bat", 4, 22, false, false, |
17224 stackTrace->GetFrame(0)); | 17224 stackTrace->GetFrame(0)); |
17225 checkStackFrame(origin, "baz", 8, 3, false, true, | 17225 checkStackFrame(origin, "baz", 8, 3, false, true, |
17226 stackTrace->GetFrame(1)); | 17226 stackTrace->GetFrame(1)); |
17227 #ifdef ENABLE_DEBUGGER_SUPPORT | |
17228 bool is_eval = true; | 17227 bool is_eval = true; |
17229 #else // ENABLE_DEBUGGER_SUPPORT | |
17230 bool is_eval = false; | |
17231 #endif // ENABLE_DEBUGGER_SUPPORT | |
17232 | |
17233 // This is the source string inside the eval which has the call to baz. | 17228 // This is the source string inside the eval which has the call to baz. |
17234 checkStackFrame(NULL, "", 1, 5, is_eval, false, | 17229 checkStackFrame(NULL, "", 1, 5, is_eval, false, |
17235 stackTrace->GetFrame(2)); | 17230 stackTrace->GetFrame(2)); |
17236 // The last frame is an anonymous function which has the initial eval call. | 17231 // The last frame is an anonymous function which has the initial eval call. |
17237 checkStackFrame(origin, "", 10, 1, false, false, | 17232 checkStackFrame(origin, "", 10, 1, false, false, |
17238 stackTrace->GetFrame(3)); | 17233 stackTrace->GetFrame(3)); |
17239 | 17234 |
17240 CHECK(stackTrace->AsArray()->IsArray()); | 17235 CHECK(stackTrace->AsArray()->IsArray()); |
17241 } | 17236 } |
17242 } | 17237 } |
(...skipping 5249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22492 v8::internal::FLAG_stack_size = 150; | 22487 v8::internal::FLAG_stack_size = 150; |
22493 LocalContext current; | 22488 LocalContext current; |
22494 v8::Isolate* isolate = current->GetIsolate(); | 22489 v8::Isolate* isolate = current->GetIsolate(); |
22495 v8::HandleScope scope(isolate); | 22490 v8::HandleScope scope(isolate); |
22496 V8::SetCaptureStackTraceForUncaughtExceptions( | 22491 V8::SetCaptureStackTraceForUncaughtExceptions( |
22497 true, 10, v8::StackTrace::kDetailed); | 22492 true, 10, v8::StackTrace::kDetailed); |
22498 v8::TryCatch try_catch; | 22493 v8::TryCatch try_catch; |
22499 CompileRun("(function f(x) { f(x+1); })(0)"); | 22494 CompileRun("(function f(x) { f(x+1); })(0)"); |
22500 CHECK(try_catch.HasCaught()); | 22495 CHECK(try_catch.HasCaught()); |
22501 } | 22496 } |
OLD | NEW |