-
Notifications
You must be signed in to change notification settings - Fork 12.8k
No escape and unescape methods in lib.d.ts #18813
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
Comments
https://www.w3schools.com/jsref/jsref_escape.asp |
MDN actually lists escape and unescape as valid ESNext functions, FYI. Working on a PR |
although the issue is marked working as expected, it is important to mention that most major browsers maintain support for escape and unescape, and some javascript codebases moving to typescript may have escape and unescape in them. They are valid JavaScript, and thus they should be included in the global definition.
This behavior is intentional. Please see #8639 (comment). You can always define: declare function escape(s:string): string;
declare function unescape(s:string): string; |
Have seen #8639 and find nothing about deprecated here. |
Copying comment from other thread @k8w those pages used to refer to it being deprecated, and it was. It does not appear to be deprecated in the current standard though, and I can't find a specific reference to why the change was made. I suspect they were retained in the specification to not break code, but you shouldn't be using them for new code as they don't handle Unicode URIs properly, and so IMO they are best to leave out and people can add them back in if they are supporting old code. |
Please see comment in #8639 (comment) |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
* add types for escape and unescape methods #18813 although the issue is marked working as expected, it is important to mention that most major browsers maintain support for escape and unescape, and some javascript codebases moving to typescript may have escape and unescape in them. They are valid JavaScript, and thus they should be included in the global definition. * add escape and unescape types to lib in tests * update tests to turn CI green
My PR got merged! This issue has been fixed. |
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
2.6.0-dev.20170926
Code
Expected behavior:
Compile succ
Actual behavior:
Compile error
The text was updated successfully, but these errors were encountered: