Skip to content

Add discouraged to schema (and with statement demo feature) #2388

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
merged 12 commits into from
Dec 20, 2024
Prev Previous commit
Next Next commit
Add discouraged with statement feature
  • Loading branch information
ddbeck committed Dec 3, 2024
commit 99cd5025d2bff980475c4efa3e476c44f64da23a
1 change: 0 additions & 1 deletion features/symbol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ compat_features:
- javascript.builtins.Symbol.toString
- javascript.builtins.Symbol.toStringTag
- javascript.builtins.Symbol.toStringTag.dom_objects
- javascript.builtins.Symbol.unscopables
- javascript.builtins.Symbol.valueOf
- javascript.builtins.Symbol.@@toPrimitive
13 changes: 0 additions & 13 deletions features/symbol.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,6 @@ compat_features:
- javascript.builtins.Symbol.for
- javascript.builtins.Symbol.keyFor

# baseline: high
# baseline_low_date: 2016-08-02
# baseline_high_date: 2019-02-02
# support:
# chrome: "38"
# chrome_android: "38"
# edge: "12"
# firefox: "48"
# firefox_android: "48"
# safari: "9"
# safari_ios: "9"
- javascript.builtins.Symbol.unscopables

# baseline: high
# baseline_low_date: 2016-09-20
# baseline_high_date: 2019-03-20
Expand Down
24 changes: 24 additions & 0 deletions features/with.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: with
description: The `with` JavaScript statement adds a given object to the chain of scopes used to evaluate names.
spec: https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-with-statement
group: javascript
discouraged:
# One thing that is potentially missing here is a "reason" like this:

# reason: browser-warning
# reason: spec-caution
# reason: pending-removal

# This would allow us to signal to tools how "fatal" the discouragement is
# (e.g., pending-removal should trigger noisy errors for developers but spec
# caution would not). I'm not sure the full range of these yet; I think it
# might be easier to choose the set of reasons after we've enumerated a bunch
# of discouraged features.
according_to:
- https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-with-statement
alternatives:
- destructuring
compat_features:
- javascript.statements.with
- javascript.builtins.Symbol.unscopables
- javascript.builtins.Array.@@unscopables
50 changes: 50 additions & 0 deletions features/with.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Generated from: with.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "38"
chrome_android: "38"
edge: "12"
firefox: "48"
firefox_android: "48"
safari: "10"
safari_ios: "10"
Comment on lines +5 to +13
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the current Baseline definition, this is correct. That said, I expect consumers (like MDN and caniuse) to choose to suppress the Baseline information when there's a discouragement.

compat_features:
# baseline: high
# baseline_low_date: 2016-08-02
# baseline_high_date: 2019-02-02
# support:
# chrome: "38"
# chrome_android: "38"
# edge: "12"
# firefox: "48"
# firefox_android: "48"
# safari: "9"
# safari_ios: "9"
- javascript.builtins.Symbol.unscopables

# baseline: high
# baseline_low_date: 2016-09-20
# baseline_high_date: 2019-03-20
# support:
# chrome: "38"
# chrome_android: "38"
# edge: "12"
# firefox: "48"
# firefox_android: "48"
# safari: "10"
# safari_ios: "10"
- javascript.builtins.Array.@@unscopables

# baseline: false
# support:
# chrome: "1"
# chrome_android: "18"
# edge: "12"
# firefox: "1"
# firefox_android: "4"
# safari: "1"
# safari_ios: "1"
- javascript.statements.with
Loading