-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
fix(#10825): location should be undefined without --location #10828
Conversation
console.warn( | ||
"Warning: accessing undefined 'location' global, " + | ||
"run again with --location", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unfortunate... typeof location !== "undefined"
would result in a warning logged to the console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove it - I wanted to address @crowlKats's concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Luca... OTOH it will be hard to discover location
API unless you plough through manual. I guess in this situation not showing warning is preferable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest that we leave the warning for the time being. Extra warning is better than confusion. If people feel strongly we can remove it later.
What do we do about the type declaration? |
Ah, that's a good point. We don't have a way to add declarations conditionally (unless it's for the |
I think we'll just have to leave the type declaration incorrect when |
We should amend the JSDoc to make it clear that |
How about aligning the behavior with private mode / incognite mode of browsers? Provides localStorage object, but doesn't actually persist data. This doesn't break type declaration, and doesn't break feature detection code (though the result of feature detection might be wrong) |
Is it no-ops, or is the localStorage effectively an instance of the session storage implementation? |
To answer my own question, both. |
This is stale. Closing without a merge. |
fixes #10825