[P2] Interpreter: Object.keys includes non-enumerable class-instance properties
Maintainers usually reply within 1 day
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
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nickna/SharpTS
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
[P2] Tests: boxed Number getter characterization expects obsolete receiver identityPossibly taken @nickna claimed this 1 day ago. Openbug priority: P2
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[P2] Tests: lazy class storage test expects erased declare fields at runtimePossibly taken @nickna claimed this 1 day ago. Openbug priority: P2
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[P2] Parser: optional computed class fields are rejectedPossibly taken @nickna claimed this 1 day ago. Openbug priority: P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[P2] Compiler: absent Promise instance properties read as null instead of undefinedPossibly taken @nickna claimed this 1 day ago. Openbug priority: P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
dev/release: verify-release-candidate.sh runs 0 Java tests with Debian's MavenPossibly taken @kou claimed this today. OpenType: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/arrow-adbc#4947 ·
Maintainers usually reply within 1 day
-
:watch: Not Triaged CAC
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/AspNetCore.Docs#38001 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Nimblesite/SharpLsp#468 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
elastic/ecs-dotnet#575 ·
-
alerts bug effort:S P2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nightscout/nocturne#2511 ·
Maintainers usually reply within 1 day