Conversation
This comment was marked as resolved.
This comment was marked as resolved.
ddbeck
left a comment
There was a problem hiding this comment.
I'm suggesting a possible alternate route here: break these out into smaller features, to make the discouragement data more useful, when it comes to referencing current (and future) alternatives data.
I'll break this down in the line comments.
| - javascript.builtins.escape | ||
| - javascript.builtins.unescape |
There was a problem hiding this comment.
I think breaking this out into a separate feature (something like "escape() and unescape()") would help us do better discouragement information. We don't have all the data for this yet (it'd be nice to reference an "internal" feature on javascript for encodeURIComponent() and friends) but I'm thinking ahead here about how a consumer like MDN might be able to use this data for useful developer content (as on the current MDN page).
| - 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 |
There was a problem hiding this comment.
These also look like they might work better as standalone HTML wrapper methods feature, an alternative being the dom feature.
| # The following properties are legacy according to: | ||
| # https://tc39.es/ecma262/#sec-object.prototype-legacy-accessor-methods | ||
| - javascript.builtins.Object.defineGetter | ||
| - javascript.builtins.Object.defineSetter | ||
| - javascript.builtins.Object.lookupGetter | ||
| - javascript.builtins.Object.lookupSetter |
There was a problem hiding this comment.
This one could be a "__defineGetter__() and __defineSetter__()" feature. For now it could have functions as an alternative, with the possibility of referencing an inner feature (get and set syntax) in the future.
| - javascript.builtins.Date.getYear | ||
| - javascript.builtins.Date.setYear |
There was a problem hiding this comment.
I guess these two could make sense together as well.
|
|
||
| # The following properties are legacy according to: | ||
| # https://tc39.es/ecma262/#sec-object.prototype.__proto__ | ||
| - javascript.builtins.Object.proto No newline at end of file |
There was a problem hiding this comment.
Now that I've gotten to the end, I'm left with just a few miscellaneous, single-key items:
__proto__RegExp.compile()toGMTString
This isn't too bad? I'd be willing to tolerate having features for these, if it makes the consistency and shape of the other features mentioned above more legible.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
@captainbrosset I've been chipping away at the keys you've mentioned in your PR description (sorry for the noise), but I also left some suggestions on the actual proposed feature in the PR. Do you wish to continue to work on this or have any new ideas? Or do you want me to take on my proposed route in a separate PR? |
|
Thanks for going deep into the details here. Feel free to implement your proposed feature breakout into separate PRs. |
…and `arguments.callee` (#2664) * Add discouraged feature for `Function.prototype.caller` and `arguments` Related-to: #2564 (comment) * Add discouraged feature for `arguments.callee` See-also: mdn/browser-compat-data#18384
I'm going over the last remaining
javascript.*BCD keys that correspond to legacy/non-standard features and that we haven't mapped yet, and trying to create features for them in the repo.A few of them are mentioned in the ECMAScript spec as legacy, which is great, because we can link that those notes in
according_to. However, a bunch of other features are simply non-standard and therefore do not exist in the spec. Maybe they once did, but not anymore, and there's no official note saying that they are now deprecated.The only feature in this PR contains the keys for which there's a note in the spec. So that's the easy case.
The other cases are listed below, with my notes:
(see #2617 and mdn/browser-compat-data#25744 and mdn/browser-compat-data#25795)
Not mentioned in the spec, only mentioned in BCD compat table on MDN.javascript.builtins.AggregateError.serializable_object(see #2690) Discouraged on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Symbol.species
Potentially related note in the spec: https://tc39.es/ecma262/#sec-arrayspeciescreate
which says something about historical browser behavior.
javascript.builtins.Array.@@species(see #2571)
Not on MDN, not in specjavascript.builtins.Atomics.pause(see #2664 and #2566) Discouraged on MDN, but no mentions in spec.
javascript.builtins.Function.argumentsjavascript.builtins.Function.callerjavascript.builtins.Function.displayName(see #2664)
Not in strict mode according to:https://tc39.es/ecma262/#sec-strict-mode-of-ecmascript
javascript.functions.arguments.callee(see #2566) Discouraged on MDN, but no mentions in spec.
javascript.builtins.InternalError.InternalErrorjavascript.builtins.InternalError(see #2584)
Mentioned as optional by MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#return_valueLikely due to this spec note: https://tc39.es/ecma402/#sec-intl.datetimeformat
javascript.builtins.Intl.DateTimeFormat.DateTimeFormat.IntlLegacyConstructedSymboljavascript.builtins.Intl.NumberFormat.NumberFormat.IntlLegacyConstructedSymbol(see #2688) Deprecated on MDN, but not mentioned in the spec
javascript.builtins.RegExp.inputjavascript.builtins.RegExp.lastMatchjavascript.builtins.RegExp.lastParenjavascript.builtins.RegExp.leftContextjavascript.builtins.RegExp.njavascript.builtins.RegExp.rightContext(see mdn/browser-compat-data#25995)
??javascript.grammar.trailing_commas.trailing_commas_in_dynamic_import(see mdn/browser-compat-data#25995)
??javascript.operators.import.options_parameter(See #2565)
MDN notes that there once was an assert keyword: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/withBut not in spec. Likely was never standard. Might need to ignore this until it gets removed from BCD.
javascript.statements.import.import_assertionsjavascript.statements.import.import_assertions.type_cssjavascript.statements.import.import_assertions.type_json(See #2566) Non-standard on MDN, and not in spec.
javascript.builtins.Error.Error.fileName_parameterjavascript.builtins.Error.Error.lineNumber_parameterjavascript.builtins.Error.cause.displayed_in_consolejavascript.builtins.Error.columnNumberjavascript.builtins.Error.fileNamejavascript.builtins.Error.lineNumberjavascript.builtins.Error.stack