Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[P2] Interpreter: Object.keys includes non-enumerable class-instance properties

Open Beginner friendly
#2,876 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@nickna is already working on this.

Since Oct 22, 2026.

  • #2897 by @nickna — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, typescript
Domain
backend, compilers

Research direction

Start in ObjectBuiltIns.EnumerateOwnEnumerable and trace how it handles SharpTSInstance; compare that path with SharpTSInstance.OwnEnumerableKeys(), which the issue identifies as applying the descriptor filter. Run the minimal program from the issue and relevant interpreter tests. Done when Object.keys(target) returns no keys for the non-enumerable property while its descriptor still reports enumerable: false.

Written by the indexing model from the issue text.

Description

bug priority: P2

Object.keys includes a non-enumerable own property on an ordinary class instance, even though its descriptor correctly reports enumerable: false.

class C {}
const target: any = new C();
Object.defineProperty(target, 'hidden', { value: 7, enumerable: false, configurable: true });
console.log(Object.keys(target).length, Object.getOwnPropertyDescriptor(target, 'hidden')!.enumerable);

Node output:

0 false

Checked interpreter output:

1 false

The exact program passes strict TypeScript 6.0.3 and the SharpTS strict-noLib noEmit gate. Node and the subsequent interpretation both exit zero with empty stderr. The four minimal-program stages closed normally with complete output under 20-second deadlines.

Confirmed on clean commit 3c1045eec8d59706bd3fb078e6bcce5808811c72, using immutable runtime SHA256 E0285AE0567F4F3FDCC80377F2235A2793DC68F463D698ABF4D6A5370C9A0AD3. This report concerns interpretation; no compiled failure or introducing commit is claimed.

ObjectBuiltIns.EnumerateOwnEnumerable handles SharpTSInstance by iterating GetFieldNames() without checking descriptor flags. The existing SharpTSInstance.OwnEnumerableKeys() helper applies the needed filter. Keep all-own reflection separate and preserve getter-free key discovery.

Found during #2874. The reduction uses a data property, so it does not depend on the explicit-undefined accessor fix. Fresh dedup found no focused class-instance owner; closed #475 covers boxed wrappers and ordinary records, while #2478 concerns class prototypes and #2430 class constructors.

Evidence: artifacts/p2-goal/2874-enumeration-current-proof/class-instance-keys-hidden-data-results.json (SHA256 8727FDA9BC0BB724B8834251378F3A49787DB963E4335497659F4D7843FAF047), reference 69578F41976405A1FF4DFE40E4875F495F6BC2F106508FC901C6BA1C5F150833, and owner assessment B66CD7C06453B8EDA7F1B7E11987FB16E59015488467108954F891CB06439DCD.

Dominant language
C#
Stars
156
Forks
4
Avg merge
4h 52m
Merged PRs (30d)
45

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nickna/SharpTS

All issues in nickna/SharpTS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.