Chromium Code Reviews| Index: src/mirror-debugger.js |
| diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js |
| index fde3f10f3f181e5adc75e56024133ef3cc35fc02..c98cc168ef1637539c0945d23935c51b4c810004 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,20 @@ ObjectMirror.GetInternalProperties = function(value) { |
| result.push(new InternalPropertyMirror("[[BoundArgs]]", boundArgs)); |
| } |
| return result; |
| + } else if (ObjectIsPromise(value)) { |
| + var result = []; |
| + var promiseStatus = builtins.GetPromiseStatus(value); |
|
aandrey
2014/05/08 15:05:16
code dup. lets make a PromiseMirror:
var mirror =
Alexandra Mikhaylova
2014/05/08 15:20:58
Done.
|
| + var statusString = ""; |
| + if (promiseStatus == 0) { |
| + statusString = "pending"; |
| + } else if (promiseStatus == 1) { |
| + statusString = "resolved"; |
| + } else { |
| + statusString = "rejected"; |
| + } |
| + result.push(new InternalPropertyMirror("[[Status]]", statusString)); |
|
aandrey
2014/05/08 15:05:16
maybe [[PromiseStatus]], [[PromiseValue]] ?
what w
Alexandra Mikhaylova
2014/05/08 15:20:58
Done.
|
| + result.push(new InternalPropertyMirror("[[Value]]", builtins.GetPromiseValue(value))); |
|
Yang
2014/05/08 14:57:51
please honor the 80-char limit.
Alexandra Mikhaylova
2014/05/08 15:20:58
Done.
|
| + return result; |
| } |
| return []; |
| } |