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
For now it may break things for some lazy users. By tolerating invalid argument values current behavior implicitly allows unconditional setUserID() invokations (I mean calling it whether or not visitor is authenticated and a valid userID is available).
Personally I see no problem in breaking this by throwing an exception on invalid userID - lazy programmers must suffer, it helps them to stop being lazy) But this is not my project to decide.
There is also related issue #7556 on resetting user id, which would be especially usefull for single-page apps. Also see my comment there.
If you're OK with my PoV, I may do this in forseeable future, when I have some time
setUserId:function(cA){if(!A(cA)||!cA.length){return} ...
If you're doing arg validation, then do it properly and check for all possibly acceptable types.
Ints should definitely be acceptable here.
And it is extremely stupid idea to silently return on invalid argument. Is it really that hard to throw a TypeError?
The text was updated successfully, but these errors were encountered: