From 93b4f186dd1385aa5568cc62038c5f4e971ee3e0 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Thu, 9 Apr 2020 14:55:40 +0200 Subject: [PATCH] Improve terminology for internal promise state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the spec [1], a resolved promise may be “pending, fulfilled, or rejected”, but previously V8 incorrectly used the term “resolved” instead of “fulfilled”. This change is user-observable through the `d8` REPL and the DevTools Console. Corresponding DevTools CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2141673 Corresponding Chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/2144095 [1]: https://tc39.es/ecma262/#sec-properties-of-promise-instances Bug: v8:6751, v8:5416 Change-Id: I6c5302c280d01cf681c6358add3d2e88fbffa36f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144011 Commit-Queue: Mathias Bynens Reviewed-by: Peter Marshall Cr-Commit-Position: refs/heads/master@{#67086} --- src/objects/objects.cc | 2 +- .../debugger/object-preview-internal-properties-expected.txt | 4 ++-- test/inspector/runtime/internal-properties-expected.txt | 2 +- test/inspector/runtime/remote-object-expected.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/objects/objects.cc b/src/objects/objects.cc index 1b9df4ea3c..9a3a3d4718 100644 --- a/src/objects/objects.cc +++ b/src/objects/objects.cc @@ -5889,7 +5889,7 @@ void JSPromise::set_status(Promise::PromiseState status) { const char* JSPromise::Status(v8::Promise::PromiseState status) { switch (status) { case v8::Promise::kFulfilled: - return "resolved"; + return "fulfilled"; case v8::Promise::kPending: return "pending"; case v8::Promise::kRejected: diff --git a/test/inspector/debugger/object-preview-internal-properties-expected.txt b/test/inspector/debugger/object-preview-internal-properties-expected.txt index d21ebc783e..bdeb37bccf 100644 --- a/test/inspector/debugger/object-preview-internal-properties-expected.txt +++ b/test/inspector/debugger/object-preview-internal-properties-expected.txt @@ -42,7 +42,7 @@ expression: Promise.resolve(42) { name : [[PromiseStatus]] type : string - value : resolved + value : fulfilled } { name : [[PromiseValue]] @@ -251,7 +251,7 @@ expression: Promise.resolve(42) { name : [[PromiseStatus]] type : string - value : resolved + value : fulfilled } { name : [[PromiseValue]] diff --git a/test/inspector/runtime/internal-properties-expected.txt b/test/inspector/runtime/internal-properties-expected.txt index 978c104866..29694d2009 100644 --- a/test/inspector/runtime/internal-properties-expected.txt +++ b/test/inspector/runtime/internal-properties-expected.txt @@ -163,7 +163,7 @@ expression: Promise.resolve(42) name : [[PromiseStatus]] value : { type : string - value : resolved + value : fulfilled } } [1] : { diff --git a/test/inspector/runtime/remote-object-expected.txt b/test/inspector/runtime/remote-object-expected.txt index 98fe47beed..4763dd18c7 100644 --- a/test/inspector/runtime/remote-object-expected.txt +++ b/test/inspector/runtime/remote-object-expected.txt @@ -1567,7 +1567,7 @@ Running test: testPromise [0] : { name : [[PromiseStatus]] type : string - value : resolved + value : fulfilled } [1] : { name : [[PromiseValue]]