Is Ecmascript's internal PropertyDescriptor an Ecmascript language value?

I'm reading ecma 262 and trying to implement a js interpreter.

In 10.1.5 [[GetOwnProperty]] ( P ), this internal method should return a Property Descriptor (which is a Record),

2. Let D be a newly created Property Descriptor with no fields.

8. Return D.

but as an internal method its result should be wrapped in Complete Record,

Object Internal Methods and Internal Slots

An internal method implicitly returns a Completion Record, either a normal completion that wraps a value of the return type shown in its invocation pattern, or a throw completion.

and Complete Record's [[Value]] should be an Ecmascript value or empty instead of a Record.

Is it a conflict, or Property Descriptor is an Ecmascipt value?

No, it's not a language value.

Currently (although this will change soon) every abstract operation's return is ALWAYS wrapped in a Completion Record implicitly, and any time you treat a Completion Record like a value, it's implicitly unwrapped as well.

3 Likes

Thank you!
So currently Complete Record can wrap everything, right?

Not currently, which leads to the conflict you pointed out. But probably soon.

1 Like

Curious question: is there a PR or issue I can look at? I'm curious about the discussion.

https://github.com/tc39/ecma262/pull/2547

1 Like