You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing { ...window.location } in the browser, you get back an object containing all the usual properties like { href: ..., origin: ..., pathname: ..., search: ..., hash: ... } etc.
In happy-dom, this does not work, since the spread operator only considers non-private fields and the Location class currently stores a private URL instead.
To Reproduce
Steps to reproduce the behavior:
Execute { ...window.location } in the dev tools of this tab
Execute a happy-dom test and log { ...window.location } out
See a noticable difference
Expected behavior
The outcome is the same (object with all properties of window.location)
Device:
any
Additional context
I suggest fixing this bug by adding non-private (they may be typescript-private but not #) fields to the location class,
which mirror the fields in the private URL field. When URL is set, also set all related fields.
The text was updated successfully, but these errors were encountered:
Describe the bug
When executing
{ ...window.location }
in the browser, you get back an object containing all the usual properties like{ href: ..., origin: ..., pathname: ..., search: ..., hash: ... }
etc.In happy-dom, this does not work, since the spread operator only considers non-private fields and the Location class currently stores a private URL instead.
To Reproduce
Steps to reproduce the behavior:
{ ...window.location }
in the dev tools of this tab{ ...window.location }
outExpected behavior
The outcome is the same (object with all properties of window.location)
Device:
Additional context
I suggest fixing this bug by adding non-private (they may be typescript-private but not #) fields to the location class,
which mirror the fields in the private URL field. When URL is set, also set all related fields.
The text was updated successfully, but these errors were encountered: