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

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

Issue 266243003: Re^3-land "Ship promises and weak collections" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/promise.js ('k') | test/cctest/test-microtask-delivery.cc » ('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 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 22320 matching lines...) Expand 10 before | Expand all | Expand 10 after
22331 histogramTimer->Start(); 22331 histogramTimer->Start();
22332 CHECK_EQ("V8.Test", last_event_message); 22332 CHECK_EQ("V8.Test", last_event_message);
22333 CHECK_EQ(0, last_event_status); 22333 CHECK_EQ(0, last_event_status);
22334 histogramTimer->Stop(); 22334 histogramTimer->Stop();
22335 CHECK_EQ("V8.Test", last_event_message); 22335 CHECK_EQ("V8.Test", last_event_message);
22336 CHECK_EQ(1, last_event_status); 22336 CHECK_EQ(1, last_event_status);
22337 } 22337 }
22338 22338
22339 22339
22340 TEST(Promises) { 22340 TEST(Promises) {
22341 i::FLAG_harmony_promises = true;
22342
22343 LocalContext context; 22341 LocalContext context;
22344 v8::Isolate* isolate = context->GetIsolate(); 22342 v8::Isolate* isolate = context->GetIsolate();
22345 v8::HandleScope scope(isolate); 22343 v8::HandleScope scope(isolate);
22346 Handle<Object> global = context->Global(); 22344 Handle<Object> global = context->Global();
22347 22345
22348 // Creation. 22346 // Creation.
22349 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); 22347 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate);
22350 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); 22348 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate);
22351 Handle<v8::Promise> p = pr->GetPromise(); 22349 Handle<v8::Promise> p = pr->GetPromise();
22352 Handle<v8::Promise> r = rr->GetPromise(); 22350 Handle<v8::Promise> r = rr->GetPromise();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
22518 v8::internal::FLAG_stack_size = 150; 22516 v8::internal::FLAG_stack_size = 150;
22519 LocalContext current; 22517 LocalContext current;
22520 v8::Isolate* isolate = current->GetIsolate(); 22518 v8::Isolate* isolate = current->GetIsolate();
22521 v8::HandleScope scope(isolate); 22519 v8::HandleScope scope(isolate);
22522 V8::SetCaptureStackTraceForUncaughtExceptions( 22520 V8::SetCaptureStackTraceForUncaughtExceptions(
22523 true, 10, v8::StackTrace::kDetailed); 22521 true, 10, v8::StackTrace::kDetailed);
22524 v8::TryCatch try_catch; 22522 v8::TryCatch try_catch;
22525 CompileRun("(function f(x) { f(x+1); })(0)"); 22523 CompileRun("(function f(x) { f(x+1); })(0)");
22526 CHECK(try_catch.HasCaught()); 22524 CHECK(try_catch.HasCaught());
22527 } 22525 }
OLDNEW
« no previous file with comments | « src/promise.js ('k') | test/cctest/test-microtask-delivery.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698