-
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?
Changes from all commits
f136856
ad8c5d8
f052c4f
8ff33f6
5e32efd
a429475
1f02a05
f900043
a969a02
7ee30da
4a1041d
2a0eff5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Accessor methods | ||
description: The `__defineGetter__()` and `__defineSetter__()` methods of objects bind a function to a property, which is called on setting or reading the property. | ||
spec: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.prototype-legacy-accessor-methods | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` because it would be `alternatives: | ||
# [object-object, functions]`. In the future it'd be nice to have an | ||
# internal reference to the object defineProperty method and the function | ||
# get/set syntax. | ||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||
compat_features: | ||
- javascript.builtins.Object.defineGetter | ||
- javascript.builtins.Object.defineSetter | ||
- javascript.builtins.Object.lookupGetter | ||
- javascript.builtins.Object.lookupSetter |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated from: accessor-methods.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "3" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.Object.defineGetter | ||
- javascript.builtins.Object.defineSetter | ||
- javascript.builtins.Object.lookupGetter | ||
- javascript.builtins.Object.lookupSetter |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Suggested change
|
||||||||||
spec: https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-date.prototype.getyear | ||||||||||
group: javascript | ||||||||||
discouraged: | ||||||||||
according_to: | ||||||||||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||||||||||
# No `alternatives` because it would be `alternatives: [date]`. In the future | ||||||||||
# it'd be nice to have an internal reference to getFullYear() and | ||||||||||
# setFullYear() instead. | ||||||||||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||||||||||
compat_features: | ||||||||||
- javascript.builtins.Date.getYear | ||||||||||
- javascript.builtins.Date.setYear |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated from: date-get-year-set-year.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "1" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.Date.getYear | ||
- javascript.builtins.Date.setYear |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: toGMTString() | ||
description: The `toGMTSTring()` method of `Date` objects is an alias to the `toUTCString()` method. | ||
spec: https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-date.prototype.togmtstring | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` because it would be `alternatives: [date]`. In the future | ||
# it'd be nice to have an internal reference to the `toUTCString()` method | ||
# instead. | ||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||
compat_features: | ||
- javascript.builtins.Date.toGMTString |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated from: date-to-gmt-string.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "1" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.Date.toGMTString |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: escape() and unescape() | ||
description: The `escape()` and `unescape()` built-in Javascript methods encode and unencode strings using percent encoding, where certain characters are replaced by hexidecimal escape sequences. | ||
spec: https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-escape-string | ||
group: javascript | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` because it would be `alternatives: [javascript]`. In the | ||
# future it'd be nice to have an internal reference to encodeURI(), | ||
# decodeURI(), encodeURIComponent(), and decodeURIComponent() instead. | ||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||
compat_features: | ||
- javascript.builtins.escape | ||
- javascript.builtins.unescape |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated from: escape-unescape.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "1" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.escape | ||
- javascript.builtins.unescape |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: HTML wrapper methods | ||
description: JavaScript built-in methods such as, `String.bold()` and `String.italics()`, wrap strings in (often historic) HTML. | ||
spec: https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-properties-of-the-string.prototype-object | ||
group: javascript | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
alternatives: | ||
- dom | ||
compat_features: | ||
- javascript.builtins.String.anchor | ||
- javascript.builtins.String.big | ||
- javascript.builtins.String.blink | ||
- javascript.builtins.String.bold | ||
- javascript.builtins.String.fixed | ||
- javascript.builtins.String.fontcolor | ||
- javascript.builtins.String.fontsize | ||
- javascript.builtins.String.italics | ||
- javascript.builtins.String.link | ||
- javascript.builtins.String.small | ||
- javascript.builtins.String.strike | ||
- javascript.builtins.String.sub | ||
- javascript.builtins.String.substr | ||
- javascript.builtins.String.sup |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated from: html-wrapper-methods.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "1" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.String.anchor | ||
- javascript.builtins.String.big | ||
- javascript.builtins.String.blink | ||
- javascript.builtins.String.bold | ||
- javascript.builtins.String.fixed | ||
- javascript.builtins.String.fontcolor | ||
- javascript.builtins.String.fontsize | ||
- javascript.builtins.String.italics | ||
- javascript.builtins.String.link | ||
- javascript.builtins.String.small | ||
- javascript.builtins.String.strike | ||
- javascript.builtins.String.sub | ||
- javascript.builtins.String.substr | ||
- javascript.builtins.String.sup |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: __proto__ | ||
description: The `__proto__` property of objects partially exposes the prototype of an object. | ||
spec: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.prototype.__proto__ | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` because it would be `alternatives: [object]`. In the | ||
# future it'd be nice to have an internal reference to `getPrototypeOf()` and | ||
# `setPrototypeOf()` instead. | ||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||
compat_features: | ||
- javascript.builtins.Object.proto |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated from: proto.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "3" | ||
safari_ios: "1" | ||
compat_features: | ||
- javascript.builtins.Object.proto |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: RegExp compile() | ||
description: The `compile()` method of `RegExp` objects recompiles an existing regular expression object using a new pattern and flags. | ||
spec: https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-regexp.prototype.compile | ||
discouraged: | ||
according_to: | ||
- https://tc39.es/ecma262/multipage/additional-ecmascript-features-for-web-browsers.html#sec-additional-ecmascript-features-for-web-browsers | ||
# No `alternatives` because it would be `alternatives: [regexp]`. In the | ||
# future it'd be nice to have an internal reference to the RegExp() | ||
# constructor instead. | ||
# See: https://github.com/web-platform-dx/web-features/issues/2676 | ||
compat_features: | ||
- javascript.builtins.RegExp.compile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated from: regexp-compile.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "1" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "1" | ||
firefox_android: "4" | ||
safari: "3.1" | ||
safari_ios: "2" | ||
compat_features: | ||
- javascript.builtins.RegExp.compile |
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.
Filed #2676 and added links to the comments with 7ee30da.