content icon indicating copy to clipboard operation
content copied to clipboard

Add page for Array_withSorted_argument type error message

Open catamorphism opened this issue 4 years ago • 12 comments

Summary

Add page for Array_withSorted_argument type error message

Motivation

Bug 1729563 adds a new Array.prototype.withSorted() method. This method can throw a type error that is similar to the one thrown by Array.prototype.sort() when the function argument is not callable, but the name is different to reflect that the method being erroneously called is withSorted().

Supporting details

Related issues

Metadata

  • [X] Adds a new document
  • [ ] Rewrites (or significantly expands) a document
  • [ ] Fixes a typo, bug, or other error

catamorphism avatar Oct 19 '21 22:10 catamorphism

Preview URLs

Flaws

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Array_withSorted_argument Title: TypeError: non-function passed to Array.prototype.withSorted on GitHub Flaw count: 2

  • macros:
    • /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/withSorted does not exist
    • /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/withSorted does not exist

External URLs

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Array_withSorted_argument Title: TypeError: non-function passed to Array.prototype.withSorted on GitHub

No new external URLs

(this comment was updated 2022-06-27 12:16:09.202680)

github-actions[bot] avatar Oct 20 '21 05:10 github-actions[bot]

Thanks for writing up the documentation for this @catamorphism.

Is the plan to wait until this proposal manages to advance to stage 3 or 4 before merging?

acutmore avatar Oct 28 '21 05:10 acutmore

Thanks for writing up the documentation for this @catamorphism.

Is the plan to wait until this proposal manages to advance to stage 3 or 4 before merging?

Doesn't necessarily have to wait (unless others think it should), but I was encouraged to submit this PR because code landed that references the error message string, so it's a broken link without the MDN page existing. That said, the code is still flag-guarded, so it doesn't seem too urgent to me. (I just haven't had a chance to fix the errors pointed out by the bot yet.)

catamorphism avatar Nov 11 '21 22:11 catamorphism

This PR has been open now for than 7 months, and rather than continuing to keep it open waiting on other things, I suggest we consider closing it for now and then re-opening when it’s clear that things have reached the point where we’re ready to merge it.

sideshowbarker avatar Jun 23 '22 12:06 sideshowbarker

I'm curious here. Shouldn't the feature be documented by now? Maybe it skipped through the Mozilla docs process, or there is another reason. @rumyra will know for sure.

The lack of documentation of the main feature is what prevents this from being merged.

teoli2003 avatar Jun 24 '22 05:06 teoli2003

Thanks @teoli2003 - yes it would absolutely appear this fell through the net (there is no dev-doc-needed & unfortunately the search to add isn't a perfect science)

I'm going to add some research for change array by copy our current release project, so hopefully we can make progress on this pr 👍

Rumyra avatar Jun 27 '22 11:06 Rumyra

(Sorry I clicked close with comment instead of delete draft comment)

teoli2003 avatar Jun 27 '22 12:06 teoli2003

I did some research. I don't think this is worth documenting yet.

  • The implementation on FF appears to be stage-2 and is behind a preference. Since then the names of the methods changed from withXxxx to toXxxxx.
  • The implementation does not seem to work even if the preference is enabled
  • No other browser vendors seem to be signaling interest (though perhaps my basic search wasn't sufficient).

Anyway, I'm querying the status in https://bugzilla.mozilla.org/show_bug.cgi?id=1729563 but until there is at least one browser compliant with the stage 3 spec I'm not sure there is much point documenting it.

hamishwillee avatar Jul 12 '22 02:07 hamishwillee

  • No other browser vendors seem to be signaling interest (though perhaps my basic search wasn't sufficient).

FYI the proposal is currently shipping in Safari tech preview.

acutmore avatar Jul 12 '22 02:07 acutmore

Thanks @acutmore ! - As you say, release 148 - change here: https://trac.webkit.org/changeset/293348/webkit/

Let's see what the plan for Firefox is too, and perhaps then I should reconsider.

hamishwillee avatar Jul 12 '22 03:07 hamishwillee

Sounds good @hamishwillee - thank you!

Rumyra avatar Jul 12 '22 11:07 Rumyra

FYI, the Moz developer responded with what is essentially "still too early" - there are some things going on with the spec and it is still quite possible the names might need to change. The FF implementation isn't even built by default for these reasons. So I take that as still to early to document.

hamishwillee avatar Jul 15 '22 06:07 hamishwillee

I'm going to close this PR for now and we can reopen when this is ready to document. Thanks all 🙌🏻

bsmth avatar Oct 05 '22 11:10 bsmth