Skip to content

<key> in <ClassRef> reports false for static data props and prototype #6149

Description

@proggeramlug

Summary

<key> in <ClassRef> reports false for a class's own static data properties
and for "prototype".

Repro

class K { static s = 1; m() {} }
console.log("s" in K);          // node: true   perry: false
console.log("prototype" in K);  // node: true   perry: false

Notes

Pre-existing (reproduces on main). A class used as a value is INT32-tagged; the
class-ref arm in js_object_has_property checks CLASS_STATIC_SYMBOLS for
symbol keys but has no string-key path for CLASS_DYNAMIC_PROPS / static data
fields (the key_val.is_string() branch is a no-op) and returns false.
Separate from the Object.create in fix (#6145).

Activity

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