- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timeStamp property missing from Event & CustomEvent #722
Labels
enhancement
New feature or request
Comments
aripalo
added a commit
to aripalo/happy-dom
that referenced
this issue
Feb 7, 2023
aripalo
added a commit
to aripalo/happy-dom
that referenced
this issue
Feb 9, 2023
Co-authored-by: David Ortner <david@ortner.se>
aripalo
added a commit
to aripalo/happy-dom
that referenced
this issue
Feb 9, 2023
Co-authored-by: David Ortner <david@ortner.se>
aripalo
added a commit
to aripalo/happy-dom
that referenced
this issue
Feb 9, 2023
capricorn86
pushed a commit
to aripalo/happy-dom
that referenced
this issue
Feb 13, 2023
capricorn86
pushed a commit
to aripalo/happy-dom
that referenced
this issue
Feb 13, 2023
capricorn86
added a commit
that referenced
this issue
Feb 13, 2023
…ing-from-event #722@minor: Add timeStamp property to Event.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Event
(and henceCustomEvent
) are missing thetimeStamp
property. This means that for example unit tests running withhappy-dom
will fail if they try to access the undefinedtimeStamp
property.Example code:
Describe the solution you'd like
Happy DOM should assign the
timeStamp
property.(I will be providing a pull request.)I've provided a Pull Request for this at #723Describe alternatives you've considered
timeStamp
is undefined – basically making the tests uselessCustomEvent
– feels dirtyAdditional context
Looking at
jsdom
implementation oftimeStamp
is just aDate.now()
– which does not match the specification (see MDN and Spec):I think we could do better: My proposed solution is to use
performance.timeOrigin
as the time origin to resolve the relative EventtimeStamp
value.The text was updated successfully, but these errors were encountered: