From 2e26506df272e974ee4a0add8fdf8d05f51fc870 Mon Sep 17 00:00:00 2001 From: Hitesh Kanwathirtha Date: Wed, 31 Jan 2018 18:06:32 -0800 Subject: [PATCH] OS 15681335: Fix inspection of Promise state in debugger RecyclablePromiseObjectWalker::Get had a missing break when inspecting the state of a promise, causing an unresolved promise to show up as resolved in F12. Fixed the logic here. --- lib/Runtime/Debug/DiagObjectModel.cpp | 1 + test/DebuggerCommon/promiseDisplay.js.dbg.baseline | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Runtime/Debug/DiagObjectModel.cpp b/lib/Runtime/Debug/DiagObjectModel.cpp index 4848fd5e912..789b1e7c3e5 100644 --- a/lib/Runtime/Debug/DiagObjectModel.cpp +++ b/lib/Runtime/Debug/DiagObjectModel.cpp @@ -3896,6 +3896,7 @@ namespace Js break; case JavascriptPromise::PromiseStatusCode_Unresolved: pResolvedObject->obj = scriptContext->GetLibrary()->CreateStringFromCppLiteral(_u("pending")); + break; case JavascriptPromise::PromiseStatusCode_HasResolution: pResolvedObject->obj = scriptContext->GetLibrary()->CreateStringFromCppLiteral(_u("resolved")); break; diff --git a/test/DebuggerCommon/promiseDisplay.js.dbg.baseline b/test/DebuggerCommon/promiseDisplay.js.dbg.baseline index 919012c34ac..efd5a306641 100644 --- a/test/DebuggerCommon/promiseDisplay.js.dbg.baseline +++ b/test/DebuggerCommon/promiseDisplay.js.dbg.baseline @@ -11,7 +11,7 @@ }, "someOtherProp": "string before", "[Promise]": { - "[status]": "string resolved", + "[status]": "string pending", "[value]": "string undefined" } }