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

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

Issue 10911305: Replace r12503. Explicitly check toString() for exception in d8's print(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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
« no previous file with comments | « src/d8.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 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 17495 matching lines...) Expand 10 before | Expand all | Expand 10 after
17506 }; 17506 };
17507 17507
17508 i::Semaphore* sem_; 17508 i::Semaphore* sem_;
17509 volatile int sem_value_; 17509 volatile int sem_value_;
17510 }; 17510 };
17511 17511
17512 17512
17513 THREADED_TEST(SemaphoreInterruption) { 17513 THREADED_TEST(SemaphoreInterruption) {
17514 ThreadInterruptTest().RunTest(); 17514 ThreadInterruptTest().RunTest();
17515 } 17515 }
17516
17517
17518 TEST(Utf8ValueException) {
17519 v8::HandleScope scope;
17520 LocalContext context;
17521
17522 Handle<Value> object = CompileRun(
17523 "var obj = { toString : function() { throw 'deadbeef'; } }; obj");
17524
17525 { v8::TryCatch try_catch;
17526 v8::String::Utf8Value utf8_value(object);
17527 CHECK(try_catch.HasCaught());
17528 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception()));
17529 }
17530
17531 { v8::TryCatch try_catch;
17532 v8::String::AsciiValue ascii_value(object);
17533 CHECK(try_catch.HasCaught());
17534 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception()));
17535 }
17536
17537 { v8::TryCatch try_catch;
17538 v8::String::Value value(object);
17539 CHECK(try_catch.HasCaught());
17540 CHECK_EQ("deadbeef", *v8::String::Utf8Value(try_catch.Exception()));
17541 }
17542
17543 // It should work fine without any TryCatch.
17544 v8::String::Utf8Value utf8_value(object);
17545 v8::String::AsciiValue ascii_value(object);
17546 v8::String::Value value(object);
17547 }
17548
17549 #endif // WIN32 17516 #endif // WIN32
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698