Skip to content

set Iterator.prototype.constructor throws TypeError: not an object when this is an ordinary object #1552

Closed

Description

@d01c2

Reproduction

Object.getOwnPropertyDescriptor(Iterator.prototype, "constructor").set.call({}, 0);

Expected

The expression evaluates to undefined with no exception thrown.

V8 (15.1.166):

d8> Object.getOwnPropertyDescriptor(Iterator.prototype, "constructor").set.call({}, 0);
undefined

Actual (QuickJS-ng)

qjs > Object.getOwnPropertyDescriptor(Iterator.prototype, "constructor").set.call({}, 0);
TypeError: not an object
    at <anonymous> (native)
    at call (native)
    at <eval> (<evalScript>:1:71)

Spec

The setter set Iterator.prototype.constructor delegates to SetterThatIgnoresPrototypeProperties. For this = {} this operation completes without any abrupt completion, so the setter must return undefined.

Versions

  • QuickJS-ng: 0.15.1
  • V8: 15.1.166

Activity

  1. saghul commented on Jun 30, 2026

    @saghul
    Contributor

    Thanks for the report!

  2. added a commit that references this issue on Jun 30, 2026
    161db12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions