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

Side by Side Diff: test/mjsunit/es6/debug-promises-update-parent-event.js

Issue 393283007: Introduce more debug events for promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --expose-debug-as debug
6
7 Debug = debug.Debug;
8
9 var exception = null;
10 var promise, parentPromise;
11
12 function listener(event, exec_state, event_data, data) {
13 if (!(event_data instanceof debug.UpdatePromiseParentEvent)) return;
14 try {
15 assertTrue(event_data.promise().isPromise());
16 promise = event_data.promise().value();
17
18 assertTrue(event_data.parentPromise().isPromise());
19 parentPromise = event_data.parentPromise().value();
20 } catch (e) {
21 print(e + e.stack);
22 exception = e;
23 }
24 }
25
26 Debug.setListener(listener);
27
28 var p1 = new Promise(function(resolve, reject) { resolve(1) });
29 var p2 = p1.then().then();
30 var p3 = p2.then();
31 assertSame(parentPromise, p2);
aandrey 2014/07/22 11:58:49 how many UpdatePromiseParentEvent happened by this
Alexandra Mikhaylova 2014/07/22 12:47:22 There should be 3 UpdatePromiseParentEvent's (adde
32 assertSame(promise, p3);
33
34 assertNull(exception);
35 Debug.setListener(null);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698