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

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

Issue 416213004: Merge three PromiseEvent's into one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Check new promise debug events in case of chained promises Created 6 years, 4 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 | « no previous file | src/promise.js » ('j') | src/promise.js » ('J')
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 // Default number of frames to include in the response to backtrace request. 5 // Default number of frames to include in the response to backtrace request.
6 var kDefaultBacktraceLength = 10; 6 var kDefaultBacktraceLength = 10;
7 7
8 var Debug = {}; 8 var Debug = {};
9 9
10 // Regular expression to skip "crud" at the beginning of a source line which is 10 // Regular expression to skip "crud" at the beginning of a source line which is
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 o.data = script.data(); 1195 o.data = script.data();
1196 } 1196 }
1197 if (include_source) { 1197 if (include_source) {
1198 o.source = script.source(); 1198 o.source = script.source();
1199 } 1199 }
1200 return o; 1200 return o;
1201 } 1201 }
1202 1202
1203 1203
1204 function MakePromiseEvent(event_data) { 1204 function MakePromiseEvent(event_data) {
1205 if (event_data.type == "new") { 1205 return new PromiseEvent(event_data);
1206 return new NewPromiseEvent(event_data);
1207 }
1208 if (event_data.type == "update") {
1209 return new UpdatePromiseStatusEvent(event_data);
1210 }
1211 if (event_data.type == "chain") {
1212 return new UpdatePromiseParentEvent(event_data);
1213 }
1214 } 1206 }
1215 1207
1216 1208
1217 function PromiseGetter() { 1209 function PromiseEvent(event_data) {
1218 return MakeMirror(this.promise_); 1210 this.type_ = event_data.type;
1219 }
1220
1221
1222 function NewPromiseEvent(event_data) {
1223 this.resolver_ = event_data.resolver;
1224 this.promise_ = event_data.promise; 1211 this.promise_ = event_data.promise;
1225 } 1212 this.parentPromise_ = event_data.parentPromise;
1226
1227
1228 NewPromiseEvent.prototype.promise = PromiseGetter;
1229
1230
1231 NewPromiseEvent.prototype.resolver = function() {
1232 return MakeMirror(this.resolver_);
1233 }
1234
1235
1236 function UpdatePromiseStatusEvent(event_data) {
1237 this.promise_ = event_data.promise;
1238 this.status_ = event_data.status; 1213 this.status_ = event_data.status;
1239 this.value_ = event_data.value; 1214 this.value_ = event_data.value;
1240 } 1215 }
1241 1216
1242 1217
1243 UpdatePromiseStatusEvent.prototype.promise = PromiseGetter; 1218 PromiseEvent.prototype.type = function() {
1219 return this.type_;
1220 }
1244 1221
1245 1222
1246 UpdatePromiseStatusEvent.prototype.status = function() { 1223 PromiseEvent.prototype.promise = function() {
1224 return MakeMirror(this.promise_);
1225 }
1226
1227
1228 PromiseEvent.prototype.parentPromise = function() {
1229 return MakeMirror(this.parentPromise_);
1230 }
1231
1232
1233 PromiseEvent.prototype.status = function() {
1247 return this.status_; 1234 return this.status_;
1248 } 1235 }
1249 1236
1250 1237
1251 UpdatePromiseStatusEvent.prototype.value = function() { 1238 PromiseEvent.prototype.value = function() {
1252 return MakeMirror(this.value_); 1239 return MakeMirror(this.value_);
1253 } 1240 }
1254 1241
1255 1242
1256 function UpdatePromiseParentEvent(event_data) {
1257 this.promise_ = event_data.promise;
1258 this.parentPromise_ = event_data.parentPromise;
1259 }
1260
1261
1262 UpdatePromiseParentEvent.prototype.promise = PromiseGetter;
1263
1264
1265 UpdatePromiseParentEvent.prototype.parentPromise = function() {
1266 return MakeMirror(this.parentPromise_);
1267 }
1268
1269
1270 function MakeAsyncTaskEvent(event_data) { 1243 function MakeAsyncTaskEvent(event_data) {
1271 return new AsyncTaskEvent(event_data); 1244 return new AsyncTaskEvent(event_data);
1272 } 1245 }
1273 1246
1274 1247
1275 function AsyncTaskEvent(event_data) { 1248 function AsyncTaskEvent(event_data) {
1276 this.type_ = event_data.type; 1249 this.type_ = event_data.type;
1277 this.name_ = event_data.name; 1250 this.name_ = event_data.name;
1278 this.id_ = event_data.id; 1251 this.id_ = event_data.id;
1279 } 1252 }
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 2581
2609 default: 2582 default:
2610 json = null; 2583 json = null;
2611 } 2584 }
2612 return json; 2585 return json;
2613 } 2586 }
2614 2587
2615 Debug.TestApi = { 2588 Debug.TestApi = {
2616 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ 2589 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_
2617 }; 2590 };
OLDNEW
« no previous file with comments | « no previous file | src/promise.js » ('j') | src/promise.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698