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

Unified Diff: src/mirror-debugger.js

Issue 273653007: Read internal properties [[PromiseStatus]] and [[PromiseValue]] of the promise. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix the test Created 6 years, 7 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 | test/mjsunit/es6/mirror-promises.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index fde3f10f3f181e5adc75e56024133ef3cc35fc02..b140343f4858086237783e96755c955d1daecfc5 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -798,7 +798,8 @@ ObjectMirror.prototype.toText = function() {
/**
* Return the internal properties of the value, such as [[PrimitiveValue]] of
- * scalar wrapper objects and properties of the bound function.
+ * scalar wrapper objects, properties of the bound function and properties of
+ * the promise.
* This method is done static to be accessible from Debug API with the bare
* values without mirrors.
* @return {Array} array (possibly empty) of InternalProperty instances
@@ -822,6 +823,14 @@ ObjectMirror.GetInternalProperties = function(value) {
result.push(new InternalPropertyMirror("[[BoundArgs]]", boundArgs));
}
return result;
+ } else if (ObjectIsPromise(value)) {
+ var mirror = new PromiseMirror(value);
Yang 2014/05/12 12:31:42 indentation.
+ var result = [];
+ result.push(new InternalPropertyMirror("[[PromiseStatus]]",
+ mirror.status()));
+ result.push(new InternalPropertyMirror("[[PromiseValue]]",
+ mirror.promiseValue()));
+ return result;
}
return [];
}
« no previous file with comments | « no previous file | test/mjsunit/es6/mirror-promises.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698