-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make EventSource properties enumerable (#2987)
* make eventsource properties enumberable * Use kEnumerableProperty for eventsource immutable fields * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
- Loading branch information
1 parent
8fce214
commit bc304ff
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict' | ||
|
||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
const { EventSource } = require('../..') // assuming the test is in test/eventsource/ | ||
|
||
test('EventSource.prototype properties are configured correctly', () => { | ||
const props = Object.entries(Object.getOwnPropertyDescriptors(EventSource.prototype)) | ||
|
||
for (const [key, value] of props) { | ||
if (key !== 'constructor') { | ||
assert(value.enumerable, `${key} is not enumerable`) | ||
} | ||
} | ||
}) |