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

Side by Side Diff: test/cctest/test-thread-termination.cc

Issue 2142933003: Move Error methods to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle exception in GetProperty Created 4 years, 5 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
« no previous file with comments | « src/v8.gyp ('k') | test/mjsunit/cross-realm-filtering.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 511
512 512
513 TEST(ErrorObjectAfterTermination) { 513 TEST(ErrorObjectAfterTermination) {
514 v8::Isolate* isolate = CcTest::isolate(); 514 v8::Isolate* isolate = CcTest::isolate();
515 v8::HandleScope scope(isolate); 515 v8::HandleScope scope(isolate);
516 v8::Local<v8::Context> context = v8::Context::New(CcTest::isolate()); 516 v8::Local<v8::Context> context = v8::Context::New(CcTest::isolate());
517 v8::Context::Scope context_scope(context); 517 v8::Context::Scope context_scope(context);
518 isolate->TerminateExecution(); 518 isolate->TerminateExecution();
519 v8::Local<v8::Value> error = v8::Exception::Error(v8_str("error")); 519 v8::Local<v8::Value> error = v8::Exception::Error(v8_str("error"));
520 // TODO(yangguo): crbug/403509. Check for empty handle instead. 520 CHECK(error->IsNativeError());
521 CHECK(error->IsUndefined());
522 } 521 }
523 522
524 523
525 void InnerTryCallTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) { 524 void InnerTryCallTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
526 CHECK(!args.GetIsolate()->IsExecutionTerminating()); 525 CHECK(!args.GetIsolate()->IsExecutionTerminating());
527 v8::Local<v8::Object> global = CcTest::global(); 526 v8::Local<v8::Object> global = CcTest::global();
528 v8::Local<v8::Function> loop = v8::Local<v8::Function>::Cast( 527 v8::Local<v8::Function> loop = v8::Local<v8::Function>::Cast(
529 global->Get(CcTest::isolate()->GetCurrentContext(), v8_str("loop")) 528 global->Get(CcTest::isolate()->GetCurrentContext(), v8_str("loop"))
530 .ToLocalChecked()); 529 .ToLocalChecked());
531 i::MaybeHandle<i::Object> result = 530 i::MaybeHandle<i::Object> result =
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 CHECK(value->IsFunction()); 583 CHECK(value->IsFunction());
585 // The first stack check after terminate has been re-requested fails. 584 // The first stack check after terminate has been re-requested fails.
586 CHECK(CompileRun("1 + 1").IsEmpty()); 585 CHECK(CompileRun("1 + 1").IsEmpty());
587 CHECK(!isolate->IsExecutionTerminating()); 586 CHECK(!isolate->IsExecutionTerminating());
588 // V8 then recovers. 587 // V8 then recovers.
589 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value( 588 v8::Maybe<int32_t> result = CompileRun("2 + 2")->Int32Value(
590 v8::Isolate::GetCurrent()->GetCurrentContext()); 589 v8::Isolate::GetCurrent()->GetCurrentContext());
591 CHECK_EQ(4, result.FromJust()); 590 CHECK_EQ(4, result.FromJust());
592 CHECK(!isolate->IsExecutionTerminating()); 591 CHECK(!isolate->IsExecutionTerminating());
593 } 592 }
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | test/mjsunit/cross-realm-filtering.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698