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

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

Issue 2606093002: [promises] Refactor debug code (Closed)
Patch Set: fix stuff Created 3 years, 11 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/debug/debug.cc ('k') | src/factory.h » ('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) { 5 (function (global, utils) {
6 "use strict"; 6 "use strict";
7 7
8 // ---------------------------------------------------------------------------- 8 // ----------------------------------------------------------------------------
9 // Imports 9 // Imports
10 10
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 if (!IS_UNDEFINED(script.data())) { 1081 if (!IS_UNDEFINED(script.data())) {
1082 o.data = script.data(); 1082 o.data = script.data();
1083 } 1083 }
1084 if (include_source) { 1084 if (include_source) {
1085 o.source = script.source(); 1085 o.source = script.source();
1086 } 1086 }
1087 return o; 1087 return o;
1088 } 1088 }
1089 1089
1090 1090
1091 function PromiseDebugActionNameToString(name) {
1092 switch (name) {
1093 case kAsyncFunction: return "async function";
1094 case kPromiseResolve: return "Promise.resolve";
1095 case kPromiseReject: return "Promise.reject";
1096 case kPromiseResolveThenableJob: return "PromiseResolveThenableJob";
1097 }
1098 }
1099
1100 function PromiseDebugActionTypeToString(type) {
1101 switch (type) {
1102 case kEnqueue: return "enqueue";
1103 case kEnqueueRecurring: return "enqueueRecurring";
1104 case kCancel: return "cancel";
1105 case kWillHandle: return "willHandle";
1106 case kDidHandle: return "didHandle";
1107 }
1108 }
1109
1091 function MakeAsyncTaskEvent(type, id, name) { 1110 function MakeAsyncTaskEvent(type, id, name) {
1092 return new AsyncTaskEvent(type, id, name); 1111 return new AsyncTaskEvent(PromiseDebugActionTypeToString(type),
1112 id, PromiseDebugActionNameToString(name));
1093 } 1113 }
1094 1114
1095 1115
1096 function AsyncTaskEvent(type, id, name) { 1116 function AsyncTaskEvent(type, id, name) {
1097 this.type_ = type; 1117 this.type_ = type;
1098 this.id_ = id; 1118 this.id_ = id;
1099 this.name_ = name; 1119 this.name_ = name;
1100 } 1120 }
1101 1121
1102 1122
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 utils.InstallFunctions(utils, DONT_ENUM, [ 2410 utils.InstallFunctions(utils, DONT_ENUM, [
2391 "MakeExecutionState", MakeExecutionState, 2411 "MakeExecutionState", MakeExecutionState,
2392 "MakeExceptionEvent", MakeExceptionEvent, 2412 "MakeExceptionEvent", MakeExceptionEvent,
2393 "MakeBreakEvent", MakeBreakEvent, 2413 "MakeBreakEvent", MakeBreakEvent,
2394 "MakeCompileEvent", MakeCompileEvent, 2414 "MakeCompileEvent", MakeCompileEvent,
2395 "MakeAsyncTaskEvent", MakeAsyncTaskEvent, 2415 "MakeAsyncTaskEvent", MakeAsyncTaskEvent,
2396 "IsBreakPointTriggered", IsBreakPointTriggered, 2416 "IsBreakPointTriggered", IsBreakPointTriggered,
2397 ]); 2417 ]);
2398 2418
2399 }) 2419 })
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698