Created
February 13, 2018 22:33
-
-
Save jimblandy/6f89f8cb5453cc4d95e46dd4fb89dfc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/devtools/server/actors/object.js b/devtools/server/actors/object.js | |
--- a/devtools/server/actors/object.js | |
+++ b/devtools/server/actors/object.js | |
@@ -397,17 +397,22 @@ ObjectActor.prototype = { | |
obj._safeGetters = null; | |
continue; | |
} | |
let result = getter.call(this.obj); | |
if (result && !("throw" in result)) { | |
let getterValue = undefined; | |
if ("return" in result) { | |
- getterValue = result.return; | |
+ // Promise-returning getters always return a promise; but it might be rejected. | |
+ // treat that as if the call threw an exception. | |
+ if (!(result.return.isPromise && | |
+ result.return.promiseState === "rejected")) { | |
+ getterValue = result.return; | |
+ } | |
} else if ("yield" in result) { | |
getterValue = result.yield; | |
} | |
// WebIDL attributes specified with the LenientThis extended attribute | |
// return undefined and should be ignored. | |
if (getterValue !== undefined) { | |
safeGetterValues[name] = { | |
getterValue: this.hooks.createValueGrip(getterValue), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment