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 17460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17471 }; | 17471 }; |
17472 | 17472 |
17473 i::Semaphore* sem_; | 17473 i::Semaphore* sem_; |
17474 volatile int sem_value_; | 17474 volatile int sem_value_; |
17475 }; | 17475 }; |
17476 | 17476 |
17477 | 17477 |
17478 THREADED_TEST(SemaphoreInterruption) { | 17478 THREADED_TEST(SemaphoreInterruption) { |
17479 ThreadInterruptTest().RunTest(); | 17479 ThreadInterruptTest().RunTest(); |
17480 } | 17480 } |
| 17481 |
| 17482 |
| 17483 TEST(Utf8ValueException) { |
| 17484 v8::HandleScope scope; |
| 17485 LocalContext context; |
| 17486 |
| 17487 Handle<Value> object = CompileRun( |
| 17488 "var obj = { toString : function() { throw 'deadbeef'; } }; obj"); |
| 17489 |
| 17490 { v8::TryCatch try_catch; |
| 17491 v8::String::Utf8Value utf8_value(object); |
| 17492 CHECK(try_catch.HasCaught()); |
| 17493 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception())); |
| 17494 } |
| 17495 |
| 17496 { v8::TryCatch try_catch; |
| 17497 v8::String::AsciiValue ascii_value(object); |
| 17498 CHECK(try_catch.HasCaught()); |
| 17499 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception())); |
| 17500 } |
| 17501 |
| 17502 { v8::TryCatch try_catch; |
| 17503 v8::String::Value value(object); |
| 17504 CHECK(try_catch.HasCaught()); |
| 17505 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception())); |
| 17506 } |
| 17507 |
| 17508 // It should work fine without any TryCatch. |
| 17509 v8::String::Utf8Value utf8_value(object); |
| 17510 v8::String::AsciiValue ascii_value(object); |
| 17511 v8::String::Value value(object); |
| 17512 } |
| 17513 |
17481 #endif // WIN32 | 17514 #endif // WIN32 |
OLD | NEW |