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 7535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7546 CHECK_EQ(2, message->GetLineNumber()); | 7546 CHECK_EQ(2, message->GetLineNumber()); |
7547 CHECK_EQ(9, message->GetStartColumn()); | 7547 CHECK_EQ(9, message->GetStartColumn()); |
7548 | 7548 |
7549 // Should be empty stack trace. | 7549 // Should be empty stack trace. |
7550 stackTrace = message->GetStackTrace(); | 7550 stackTrace = message->GetStackTrace(); |
7551 CHECK(stackTrace.IsEmpty()); | 7551 CHECK(stackTrace.IsEmpty()); |
7552 CHECK(v8::Exception::GetStackTrace(error).IsEmpty()); | 7552 CHECK(v8::Exception::GetStackTrace(error).IsEmpty()); |
7553 } | 7553 } |
7554 | 7554 |
7555 | 7555 |
| 7556 THREADED_TEST(ExceptionCreateMessageLength) { |
| 7557 LocalContext context; |
| 7558 v8::HandleScope scope(context->GetIsolate()); |
| 7559 |
| 7560 // Test that the message is not truncated. |
| 7561 TryCatch try_catch(context->GetIsolate()); |
| 7562 CompileRun( |
| 7563 "var message = 'm';" |
| 7564 "while (message.length < 1000) message += message;" |
| 7565 "throw message;"); |
| 7566 CHECK(try_catch.HasCaught()); |
| 7567 |
| 7568 CHECK_LT(1000, try_catch.Message()->Get()->Length()); |
| 7569 } |
| 7570 |
| 7571 |
7556 static void YGetter(Local<String> name, | 7572 static void YGetter(Local<String> name, |
7557 const v8::PropertyCallbackInfo<v8::Value>& info) { | 7573 const v8::PropertyCallbackInfo<v8::Value>& info) { |
7558 ApiTestFuzzer::Fuzz(); | 7574 ApiTestFuzzer::Fuzz(); |
7559 info.GetReturnValue().Set(v8_num(10)); | 7575 info.GetReturnValue().Set(v8_num(10)); |
7560 } | 7576 } |
7561 | 7577 |
7562 | 7578 |
7563 static void YSetter(Local<String> name, | 7579 static void YSetter(Local<String> name, |
7564 Local<Value> value, | 7580 Local<Value> value, |
7565 const v8::PropertyCallbackInfo<void>& info) { | 7581 const v8::PropertyCallbackInfo<void>& info) { |
(...skipping 14172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21738 CHECK(set->Has(env.local(), set).FromJust()); | 21754 CHECK(set->Has(env.local(), set).FromJust()); |
21739 | 21755 |
21740 CHECK(set->Delete(env.local(), set).FromJust()); | 21756 CHECK(set->Delete(env.local(), set).FromJust()); |
21741 CHECK_EQ(2U, set->Size()); | 21757 CHECK_EQ(2U, set->Size()); |
21742 CHECK(!set->Has(env.local(), set).FromJust()); | 21758 CHECK(!set->Has(env.local(), set).FromJust()); |
21743 CHECK(!set->Delete(env.local(), set).FromJust()); | 21759 CHECK(!set->Delete(env.local(), set).FromJust()); |
21744 | 21760 |
21745 set->Clear(); | 21761 set->Clear(); |
21746 CHECK_EQ(0U, set->Size()); | 21762 CHECK_EQ(0U, set->Size()); |
21747 } | 21763 } |
OLD | NEW |