# There is a contradiction in the description of \[\[getPrototypeOf\]\] and its algorithm.

**URL:** <https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524>\
**Category:** Spec Reading\
**Created:** [March 22, 2026, 3:05pm UTC](https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524 "2026-03-22T15:05:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dima-frunkers](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/dima-frunkers/32/2646_2.png) [@dima-frunkers](https://es.discourse.group/u/dima-frunkers)\
**Post date:** [March 22, 2026, 3:05pm UTC](https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524/1 "2026-03-22T15:05:56Z")

</div>

Let me introduce the term _ **description** _. This is the text from the “Description“ cell of the _internal method_ `[[setPrototypeOf]]` in the specification table [_Table 4: Essential internal methods_](https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#table-essential-internal-methods).

Also, below I use the term _target_ from the [specification clause](https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-invariants-of-the-essential-internal-methods).

> The _target_ of an internal method is the object upon which the internal method is called.

I only recently started reading the specification. I think I'm confused by the _ **description** _.

```javascript
var obj_proto = {};
var obj = {};
Object.setPrototypeOf(obj_proto, null);
Object.setPrototypeOf(obj, obj_proto);

```

I've included this code solely to illustrate the operation of the _internal method_ `[[setPrototypeOf]]` algorithm works, because it is used in the algorithm of the _internal method_ `[[setPrototypeOf]]` of the _built-in_ Object constructor, and the _built-in_ Object constructor is present in the _implementation_ (or _host_, I'm not sure). This question isn't about the _implementation_ (or _host_).

1. The `obj_proto` object is the _prototype_ for the `obj` object. `obj_proto` has no _prototype_. If I understand correctly, the `obj_proto` _prototype_ does not provide any _shared properties_ for the `obj` object.

2. According to the _ **description** _, if I pass an object as the `[[setPrototypeOf]]` argument, it means that the object provides _inherited properties_ to the _target_. If I pass null, it means that the _target_ has no _inherited properties_.

3. No one provides _inherited properties_ for `obj`. This means, according to the _ **description** _, I passed null to `[[setPrototypeOf]]`.

I see a contradiction between what is written in the _ **description** _ and how the algorithm of the _internal method_ `[[setPrototypeOf]]` is written.

I have no issues with the algorithm. It's wonderful. But if my reasoning is correct, I think it would be better to change the first sentence of the _ **description** _ from “Associate this object with another object that provides inherited properties.“ to “Associate this object with another object.“.

_PS (23.03)_:  
I was wondering. From a specification standpoint, a _[prototype](https://tc39.es/ecma262/multipage/overview.html#sec-terms-and-definitions-prototype)_ is an object that provides _shared properties_ for other objects.

If `obj_proto` doesn't provide any _shared properties_ for `obj`, is it a _prototype_ for `obj`?

---

<div class="post-metadata">

**Author:** ![conartist6](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/conartist6/32/515_2.png) [@conartist6](https://es.discourse.group/u/conartist6)\
**Post date:** [March 23, 2026, 12:34pm UTC](https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524/2 "2026-03-23T12:34:02Z")

</div>

I think I see where you got confused:

> The `obj_proto` object is the _prototype_ for the `obj` object. `obj_proto` has no _prototype_. If I understand correctly, the `obj_proto` _prototype_ does not provide any _shared properties_ for the `obj` object.

The thing is: for `obj_proto` both own methods **and** prototype methods would become available on `obj`.

```js
var obj_proto = { protoMethod() {} };
var obj = { objMethod() {} };

Object.setPrototypeOf(obj_proto, null);
Object.setPrototypeOf(obj, obj_proto);

// This exists because it exists on obj_proto
obj.protoMethod; // [Function]

// Not here because of setPrototypeOf(obj_proto, null)
obj.hasOwnProperty; // null

```

---

<div class="post-metadata">

**Author:** ![bergus](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bergus/32/152_2.png) [@bergus](https://es.discourse.group/u/bergus)\
**Post date:** [March 23, 2026, 8:17pm UTC](https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524/3 "2026-03-23T20:17:16Z")

</div>

Hi!

> 1. The `obj_proto` object is the _prototype_ for the `obj` object. `obj_proto` has no _prototype_. If I understand correctly, the `obj_proto` _prototype_ does not provide any _inherited properties_ for the `obj` object.

And yet, at the same time, `obj_proto` does provide _all_ inherited  
properties for the `obj` object. This is a [vacuous  
truth](https://en.wikipedia.org/wiki/Vacuous_truth) if `obj_proto` does  
(currently) have no properties at all.

Notice that once you modify `obj_proto` by adding some properties, one  
of the statements stays true and the other becomes false.

> 1. No one provides _inherited properties_ for `obj`. This means, according to the _ **description** _, I passed null to `[[setPrototypeOf]]`.

No, you cannot infer that. The description is not a statement of formal  
logic, and if it was, it would not be biconditional.

> I think it would be better to change the first sentence of the _ **description** _ from “Associate this object with another object that provides inherited properties.“ to “Associate this object with another object.“.

No, by that change the description becomes meaningless, if it does not  
state the type of the association.

kind regards,  
Bergi

---

<div class="post-metadata">

**Author:** ![dima-frunkers](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/dima-frunkers/32/2646_2.png) [@dima-frunkers](https://es.discourse.group/u/dima-frunkers)\
**Post date:** [March 24, 2026, 8:54am UTC](https://es.discourse.group/t/there-is-a-contradiction-in-the-description-of-getprototypeof-and-its-algorithm/2524/4 "2026-03-24T08:54:37Z")

</div>

Thank you very much. I didn't know empty truth existed. Now everything becomes clear.
