Closed eladalon1983 closed 11 months ago
I favor throwing an error, because I am concerned that Web developers might otherwise be confused about the interaction between cropTo()
and restrictTo()
, and might mistakenly think that the operations can be composed one on top of the other.
The "override" behavior can still be achieved by calling cropTo(null)
right before calling restrictTo(token2)
.
PR #35 updates the spec to implement override behavior, at least in the cropTo()
=> restrictTo()
direction.
Unless there are objections to that solution, this can be closed out.
Thanks for the reminder.
To document some rationale for the selected behavior:
Closing this issue now. If anyone objects - please comment and we can reopen.
Assume the following code:
Assume that both
token1
andtoken2
are valid tokens (rather thannull
), and might even be the identical. Further, the relative order ofcropTo()
andrestrictTo()
is irrelevant.Question: Should we specify that line2 throws an error, or should we specify that it overrides line1?