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

Side by Side Diff: src/js/promise.js

Issue 2037653002: Some new/fixed async tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adjust test expectations for Sathya's optimization Created 4 years, 6 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 | « no previous file | test/mjsunit/es6/debug-promises/async-task-event.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 %PromiseRevokeReject(resolution); 271 %PromiseRevokeReject(resolution);
272 } 272 }
273 RejectPromise(promise, thenableValue); 273 RejectPromise(promise, thenableValue);
274 SET_PRIVATE(resolution, promiseHasHandlerSymbol, true); 274 SET_PRIVATE(resolution, promiseHasHandlerSymbol, true);
275 return; 275 return;
276 } 276 }
277 } 277 }
278 278
279 if (IS_CALLABLE(then)) { 279 if (IS_CALLABLE(then)) {
280 // PromiseResolveThenableJob 280 // PromiseResolveThenableJob
281 var id, name, instrumenting = DEBUG_IS_ACTIVE; 281 var id;
282 var name = "PromiseResolveThenableJob";
283 var instrumenting = DEBUG_IS_ACTIVE;
282 %EnqueueMicrotask(function() { 284 %EnqueueMicrotask(function() {
283 if (instrumenting) { 285 if (instrumenting) {
284 %DebugAsyncTaskEvent({ type: "willHandle", id: id, name: name }); 286 %DebugAsyncTaskEvent({ type: "willHandle", id: id, name: name });
285 } 287 }
286 var callbacks = CreateResolvingFunctions(promise); 288 var callbacks = CreateResolvingFunctions(promise);
287 try { 289 try {
288 %_Call(then, resolution, callbacks.resolve, callbacks.reject); 290 %_Call(then, resolution, callbacks.resolve, callbacks.reject);
289 } catch (e) { 291 } catch (e) {
290 %_Call(callbacks.reject, UNDEFINED, e); 292 %_Call(callbacks.reject, UNDEFINED, e);
291 } 293 }
292 if (instrumenting) { 294 if (instrumenting) {
293 %DebugAsyncTaskEvent({ type: "didHandle", id: id, name: name }); 295 %DebugAsyncTaskEvent({ type: "didHandle", id: id, name: name });
294 } 296 }
295 }); 297 });
296 if (instrumenting) { 298 if (instrumenting) {
297 id = ++lastMicrotaskId; 299 id = ++lastMicrotaskId;
298 name = "PromseResolveThenableJob";
299 %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name }); 300 %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name });
300 } 301 }
301 return; 302 return;
302 } 303 }
303 } 304 }
304 FulfillPromise(promise, kFulfilled, resolution, promiseFulfillReactionsSymbol) ; 305 FulfillPromise(promise, kFulfilled, resolution, promiseFulfillReactionsSymbol) ;
305 } 306 }
306 307
307 // ES#sec-rejectpromise 308 // ES#sec-rejectpromise
308 // RejectPromise ( promise, reason ) 309 // RejectPromise ( promise, reason )
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 to.PromiseChain = PromiseChain; 611 to.PromiseChain = PromiseChain;
611 to.PromiseDefer = PromiseDefer; 612 to.PromiseDefer = PromiseDefer;
612 to.PromiseAccept = PromiseAccept; 613 to.PromiseAccept = PromiseAccept;
613 614
614 to.PromiseCreateRejected = PromiseCreateRejected; 615 to.PromiseCreateRejected = PromiseCreateRejected;
615 to.PromiseCreateResolved = PromiseCreateResolved; 616 to.PromiseCreateResolved = PromiseCreateResolved;
616 to.PromiseThen = PromiseThen; 617 to.PromiseThen = PromiseThen;
617 }); 618 });
618 619
619 }) 620 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-promises/async-task-event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698