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

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: Fix formatting 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') | 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 // 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_);
1219 }
1220
1221
1222 function NewPromiseEvent(event_data) {
1223 this.resolver_ = event_data.resolver;
1224 this.promise_ = event_data.promise; 1210 this.promise_ = event_data.promise;
1225 } 1211 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; 1212 this.status_ = event_data.status;
1239 this.value_ = event_data.value; 1213 this.value_ = event_data.value;
1240 } 1214 }
1241 1215
1242 1216
1243 UpdatePromiseStatusEvent.prototype.promise = PromiseGetter; 1217 PromiseEvent.prototype.promise = function() {
1218 return MakeMirror(this.promise_);
1219 }
1244 1220
1245 1221
1246 UpdatePromiseStatusEvent.prototype.status = function() { 1222 PromiseEvent.prototype.parentPromise = function() {
1223 return MakeMirror(this.parentPromise_);
1224 }
1225
1226
1227 PromiseEvent.prototype.status = function() {
1247 return this.status_; 1228 return this.status_;
1248 } 1229 }
1249 1230
1250 1231
1251 UpdatePromiseStatusEvent.prototype.value = function() { 1232 PromiseEvent.prototype.value = function() {
1252 return MakeMirror(this.value_); 1233 return MakeMirror(this.value_);
1253 } 1234 }
1254 1235
1255 1236
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) { 1237 function MakeAsyncTaskEvent(event_data) {
1271 return new AsyncTaskEvent(event_data); 1238 return new AsyncTaskEvent(event_data);
1272 } 1239 }
1273 1240
1274 1241
1275 function AsyncTaskEvent(event_data) { 1242 function AsyncTaskEvent(event_data) {
1276 this.type_ = event_data.type; 1243 this.type_ = event_data.type;
1277 this.name_ = event_data.name; 1244 this.name_ = event_data.name;
1278 this.id_ = event_data.id; 1245 this.id_ = event_data.id;
1279 } 1246 }
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 2575
2609 default: 2576 default:
2610 json = null; 2577 json = null;
2611 } 2578 }
2612 return json; 2579 return json;
2613 } 2580 }
2614 2581
2615 Debug.TestApi = { 2582 Debug.TestApi = {
2616 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ 2583 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_
2617 }; 2584 };
OLDNEW
« no previous file with comments | « no previous file | src/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698