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

Unified Diff: test/mjsunit/harmony/debug-async-function-async-task-event.js

Issue 2357423002: Improve stack traces for async functions (Closed)
Patch Set: REbase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/debug-async-function-async-task-event.js
diff --git a/test/mjsunit/harmony/debug-async-function-async-task-event.js b/test/mjsunit/harmony/debug-async-function-async-task-event.js
index 5e01938f361b6ef7ecf123cb2aecd5901cf71da0..90e13d8659a3f81856e1bdc3b8f972405f3cfe9c 100644
--- a/test/mjsunit/harmony/debug-async-function-async-task-event.js
+++ b/test/mjsunit/harmony/debug-async-function-async-task-event.js
@@ -5,9 +5,14 @@
// Flags: --harmony-async-await --expose-debug-as debug --allow-natives-syntax
// The test observes the callbacks that async/await makes to the inspector
-// to make accurate stack traces. The limited number of events is an
-// indirect indication that we are not doing extra Promise processing that
-// could be associated with memory leaks (v8:5380).
+// to make accurate stack traces. The pattern is based on saving a stack once
+// with enqueueRecurring and restoring it multiple times.
+
+// Additionally, the limited number of events is an indirect indication that
+// we are not doing extra Promise processing that could be associated with memory
+// leaks (v8:5380). In particular, no stacks are saved and restored for extra
+// Promise handling on throwaway Promises.
+
// TODO(littledan): Write a test that demonstrates that the memory leak in
// the exception case is fixed.
@@ -16,14 +21,14 @@ Debug = debug.Debug;
var base_id = -1;
var exception = null;
var expected = [
- 'enqueue #1',
+ 'enqueueRecurring #1',
'willHandle #1',
'then #1',
- 'enqueue #2',
'didHandle #1',
- 'willHandle #2',
+ 'willHandle #1',
'then #2',
- 'didHandle #2',
+ 'cancel #1',
+ 'didHandle #1',
];
function assertLog(msg) {
@@ -41,8 +46,7 @@ function listener(event, exec_state, event_data, data) {
if (base_id < 0)
base_id = event_data.id();
var id = event_data.id() - base_id + 1;
- assertTrue("Promise.resolve" == event_data.name() ||
- "PromiseResolveThenableJob" == event_data.name());
+ assertTrue("async function" == event_data.name());
assertLog(event_data.type() + " #" + id);
} catch (e) {
print(e + e.stack)
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698