-
Notifications
You must be signed in to change notification settings - Fork 107
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
Add several discouraged JavaScript features #2670
base: main
Are you sure you want to change the base?
Conversation
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.
Just a few comments.
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` becuase it would be `alternatives: | ||
# [object-object, functions]`. In the future it'd be nice to have an |
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.
Can you open an issue about this? It'd be nice to track this. I agree that being able to deep-link into existing features would be useful.
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.
@@ -0,0 +1,13 @@ | |||
name: getYear() and setYear() | |||
description: The `getYear()` and `setYear()` methods of `Date` objects get and set the year offset to 1900, changing a date's year in way that is subject to the year 2000 problem. |
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.
description: The `getYear()` and `setYear()` methods of `Date` objects get and set the year offset to 1900, changing a date's year in way that is subject to the year 2000 problem. | |
description: The `getYear()` and `setYear()` methods of `Date` objects get and set the year offset to 1900, changing a date's year in a way that is subject to the year 2000 problem. |
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.
Wondering if "the year 2000 problem" is showing our age a little bit :)
Joking aside, I wonder how many people who read this going forward will actually know what it refers to.
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.
It's a good point. Really, that's information more suited to a (probable future) discouragement reason field. How about this more matter-of-fact version?
description: The `getYear()` and `setYear()` methods of `Date` objects get and set the year offset to 1900, changing a date's year in way that is subject to the year 2000 problem. | |
description: The `getYear()` and `setYear()` methods of `Date` objects get and set the year as an offset to 1900. |
This PR adds several discouraged JavaScript features, building on @captainbrosset's work in #2564. The features are:
__defineGetter__()
and__defineSetter__()
)Date.prototype.{get,set}Year()
Date.prototype.toGMTString()
escape()
andunescape()
global methodsString.prototype.blink()
)Object.prototype.__proto__
RegExp.prototype.compile()
Supersedes and closes #2564.