Commit 78044358 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[cleanup] Rename internal fields to match the spec

They're exposed via DevTools.

- [[PromiseStatus]] → [[PromiseState]]
- [[PromiseValue]] → [[PromiseResult]]
- [[GeneratorStatus]] → [[GeneratorState]]

Related CLs:

- Chromium CL temporarily disabling affected tests:
  https://chromium-review.googlesource.com/c/chromium/src/+/2203201
- Chromium CL re-enabling affected tests:
  https://chromium-review.googlesource.com/c/chromium/src/+/2202900

Bug: v8:10506, v8:5416
Change-Id: Id12fb0f2ba2b453139a5d74afff9021108c15f08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2202984Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67825}
parent a5038c42
......@@ -814,10 +814,10 @@ void getInternalPropertiesForPreview(
object->IsBigIntObject()) {
whitelist.emplace_back("[[PrimitiveValue]]");
} else if (object->IsPromise()) {
whitelist.emplace_back("[[PromiseStatus]]");
whitelist.emplace_back("[[PromiseValue]]");
whitelist.emplace_back("[[PromiseState]]");
whitelist.emplace_back("[[PromiseResult]]");
} else if (object->IsGeneratorObject()) {
whitelist.emplace_back("[[GeneratorStatus]]");
whitelist.emplace_back("[[GeneratorState]]");
}
for (auto& mirror : mirrors) {
if (std::find(whitelist.begin(), whitelist.end(), mirror.name) ==
......
......@@ -241,7 +241,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
Handle<FixedArray> result = factory->NewFixedArray(2 * 3);
Handle<String> generator_status =
factory->NewStringFromAsciiChecked("[[GeneratorStatus]]");
factory->NewStringFromAsciiChecked("[[GeneratorState]]");
result->set(0, *generator_status);
Handle<String> status_str = factory->NewStringFromAsciiChecked(status);
result->set(1, *status_str);
......@@ -261,7 +261,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
const char* status = JSPromise::Status(promise->status());
Handle<FixedArray> result = factory->NewFixedArray(2 * 2);
Handle<String> promise_status =
factory->NewStringFromAsciiChecked("[[PromiseStatus]]");
factory->NewStringFromAsciiChecked("[[PromiseState]]");
result->set(0, *promise_status);
Handle<String> status_str = factory->NewStringFromAsciiChecked(status);
result->set(1, *status_str);
......@@ -271,7 +271,7 @@ MaybeHandle<JSArray> Runtime::GetInternalProperties(Isolate* isolate,
: promise->result(),
isolate);
Handle<String> promise_value =
factory->NewStringFromAsciiChecked("[[PromiseValue]]");
factory->NewStringFromAsciiChecked("[[PromiseResult]]");
result->set(2, *promise_value);
result->set(3, *value_obj);
return factory->NewJSArrayWithElements(result);
......
......@@ -40,24 +40,24 @@ expression: Object(BigInt(2))
Running test: promise
expression: Promise.resolve(42)
{
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : fulfilled
}
{
name : [[PromiseValue]]
name : [[PromiseResult]]
type : number
value : 42
}
expression: new Promise(() => undefined)
{
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : pending
}
{
name : [[PromiseValue]]
name : [[PromiseResult]]
type : undefined
value : undefined
}
......@@ -66,7 +66,7 @@ expression: new Promise(() => undefined)
Running test: generatorObject
expression: (function* foo() { yield 1 })()
{
name : [[GeneratorStatus]]
name : [[GeneratorState]]
type : string
value : suspended
}
......@@ -249,12 +249,12 @@ expression: ({})
Running test: overridenArrayGetter
expression: Promise.resolve(42)
{
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : fulfilled
}
{
name : [[PromiseValue]]
name : [[PromiseResult]]
type : number
value : 42
}
......
......@@ -160,14 +160,14 @@ expression: Promise.resolve(42)
result : {
internalProperties : [
[0] : {
name : [[PromiseStatus]]
name : [[PromiseState]]
value : {
type : string
value : fulfilled
}
}
[1] : {
name : [[PromiseValue]]
name : [[PromiseResult]]
value : {
description : 42
type : number
......@@ -183,14 +183,14 @@ expression: new Promise(() => undefined)
result : {
internalProperties : [
[0] : {
name : [[PromiseStatus]]
name : [[PromiseState]]
value : {
type : string
value : pending
}
}
[1] : {
name : [[PromiseValue]]
name : [[PromiseResult]]
value : {
type : undefined
}
......@@ -219,7 +219,7 @@ expression: gen1
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : suspended
......@@ -275,7 +275,7 @@ expression: gen1.next();gen1
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : suspended
......@@ -331,7 +331,7 @@ expression: gen1.next();gen1
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : closed
......@@ -379,7 +379,7 @@ expression: gen2
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : suspended
......@@ -435,7 +435,7 @@ expression: gen2.next();gen2
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : suspended
......@@ -491,7 +491,7 @@ expression: gen2.next();gen2
}
}
[1] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
value : {
type : string
value : closed
......
......@@ -11,7 +11,7 @@ Tests Runtime.evaluate returns object with undefined property.
overflow : false
properties : [
[0] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
type : string
value : suspended
}
......
......@@ -1274,7 +1274,7 @@ Running test: testGenerator
overflow : false
properties : [
[0] : {
name : [[GeneratorStatus]]
name : [[GeneratorState]]
type : string
value : suspended
}
......@@ -1565,12 +1565,12 @@ Running test: testPromise
overflow : false
properties : [
[0] : {
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : fulfilled
}
[1] : {
name : [[PromiseValue]]
name : [[PromiseResult]]
type : string
value : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
}
......@@ -1593,12 +1593,12 @@ Running test: testPromise
overflow : false
properties : [
[0] : {
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : rejected
}
[1] : {
name : [[PromiseValue]]
name : [[PromiseResult]]
type : number
value : 42
}
......@@ -1621,12 +1621,12 @@ Running test: testPromise
overflow : false
properties : [
[0] : {
name : [[PromiseStatus]]
name : [[PromiseState]]
type : string
value : pending
}
[1] : {
name : [[PromiseValue]]
name : [[PromiseResult]]
type : undefined
value : undefined
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment