-
Notifications
You must be signed in to change notification settings - Fork 135
Add several discouraged JavaScript features #2670
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
Merged
captainbrosset
merged 13 commits into
web-platform-dx:main
from
ddbeck:discouraged-javascript
Mar 1, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f136856
JS discouraged feature
captainbrosset ad8c5d8
Add discouraged feature for discouraged `escape()` and `unescape()`
ddbeck f052c4f
Add discouraged HTML wrapper methods feature
ddbeck 8ff33f6
Add discouraged feature for `Date.prototype.{get,set}Year()`
ddbeck 5e32efd
Add discouraged feature for getter and setter defining methods
ddbeck a429475
Add discouraged feature for `__proto__`
ddbeck 1f02a05
Add discouraged feature for the `RegExp` `compile()` method
ddbeck f900043
Add discouraged feature for `toGMTString()` method
ddbeck a969a02
Fix typos
ddbeck 7ee30da
Cross-reference issue about feature subsetting for alternatives
ddbeck 4a1041d
Add missing link
ddbeck 2a0eff5
Merge branch 'main' into discouraged-javascript
ddbeck 117674f
Update date-get-year-set-year.yml
captainbrosset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 as an offset to 1900. | ||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.