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
I think we would not do any significant validation on the inputs, e.g. we would not validate key/id at all besides casting the input to a string. (Possible validations would include checking that they're valid UUIDs, checking that they're valid v4 UUIDs, and checking that they're appropriate key/id UUIDs of actual history entries.)
The only potential downside of this is that unsuspecting code might end up getting synthetic NavigationDestination or NavigationHistoryEntry instances that break the invariants the code usually relies on. E.g. navigation.entries()[entry.index] === entry would always be false if entry is synthetic.
The text was updated successfully, but these errors were encountered:
domenic
added
the
addition
A proposed addition which could be added later without impacting the rest of the API
label
Nov 4, 2021
domenic
changed the title
Make AppHistoryDestination and AppHistoryEntry constructible
Make NavigationDestination and NavigationHistoryEntry constructible
Mar 14, 2022
@tbondwilkinson mentions that it's helpful to sometimes create synthetic versions of these objects for unit testing purposes. This would also align with https://w3ctag.github.io/design-principles/#constructors .
I think we would not do any significant validation on the inputs, e.g. we would not validate key/id at all besides casting the input to a string. (Possible validations would include checking that they're valid UUIDs, checking that they're valid v4 UUIDs, and checking that they're appropriate key/id UUIDs of actual history entries.)
The only potential downside of this is that unsuspecting code might end up getting synthetic
NavigationDestination
orNavigationHistoryEntry
instances that break the invariants the code usually relies on. E.g.navigation.entries()[entry.index] === entry
would always be false ifentry
is synthetic.The text was updated successfully, but these errors were encountered: