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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index 78f3396a3da141754eddd76def962b5dd2249ab5..a4c8801ea6d4d52a14a44f328d7e7de1e60aab30 100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -1202,68 +1202,35 @@ function MakeScriptObject_(script, include_source) {
function MakePromiseEvent(event_data) {
- if (event_data.type == "new") {
- return new NewPromiseEvent(event_data);
- }
- if (event_data.type == "update") {
- return new UpdatePromiseStatusEvent(event_data);
- }
- if (event_data.type == "chain") {
- return new UpdatePromiseParentEvent(event_data);
- }
-}
-
-
-function PromiseGetter() {
- return MakeMirror(this.promise_);
-}
-
-
-function NewPromiseEvent(event_data) {
- this.resolver_ = event_data.resolver;
- this.promise_ = event_data.promise;
-}
-
-
-NewPromiseEvent.prototype.promise = PromiseGetter;
-
-
-NewPromiseEvent.prototype.resolver = function() {
- return MakeMirror(this.resolver_);
+ return new PromiseEvent(event_data);
}
-function UpdatePromiseStatusEvent(event_data) {
+function PromiseEvent(event_data) {
this.promise_ = event_data.promise;
+ this.parentPromise_ = event_data.parentPromise;
this.status_ = event_data.status;
this.value_ = event_data.value;
}
-UpdatePromiseStatusEvent.prototype.promise = PromiseGetter;
-
-
-UpdatePromiseStatusEvent.prototype.status = function() {
- return this.status_;
+PromiseEvent.prototype.promise = function() {
+ return MakeMirror(this.promise_);
}
-UpdatePromiseStatusEvent.prototype.value = function() {
- return MakeMirror(this.value_);
+PromiseEvent.prototype.parentPromise = function() {
+ return MakeMirror(this.parentPromise_);
}
-function UpdatePromiseParentEvent(event_data) {
- this.promise_ = event_data.promise;
- this.parentPromise_ = event_data.parentPromise;
+PromiseEvent.prototype.status = function() {
+ return this.status_;
}
-UpdatePromiseParentEvent.prototype.promise = PromiseGetter;
-
-
-UpdatePromiseParentEvent.prototype.parentPromise = function() {
- return MakeMirror(this.parentPromise_);
+PromiseEvent.prototype.value = function() {
+ return MakeMirror(this.value_);
}
« 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