Skip to content
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

doc: fix links order in Assert doc #5074

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/assert.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@ assert.throws(
);
```

[Locked]: documentation.html#documentation_stability_index
[`assert.deepEqual()`]: #assert_assert_deepequal_actual_expected_message
[`assert.deepStrictEqual()`]: #assert_assert_deepstrictequal_actual_expected_message
[`assert.ok()`]: #assert_assert_ok_value_message
[`assert.throws()`]: #assert_assert_throws_block_error_message
[`Error`]: errors.html#errors_class_error
[`RegExp`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
[`TypeError`]: errors.html#errors_class_typeerror
[Locked]: documentation.html#documentation_stability_index

Choose a reason for hiding this comment

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

Wouldn't this come just before RegExp if it is in lexical (aka alphabetical) order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DavidTPate lexicographic !== alphabetic from what I know

Like: lexical (lexicographic) ⊃ alphabetical

Choose a reason for hiding this comment

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

Something just doesn't seem right, Lexicographic on Wikipedia for example.

the lexicographic or lexicographical order (also known as lexical order, dictionary order, alphabetical order or lexicographic(al) product) is a generalization of the way the alphabetical order of words is based on the alphabetical order of their component letters.

This isn't ordered by the ASCII values as A (#65) comes before a (#97) in ASCII values. As an example:

['Locked', 'assert.deepEqual()', 'assert.deepStrictEqual()', 'assert.ok()','Error','RegExp', 'TypeError'].sort();
// ["Error", "Locked", "RegExp", "TypeError", "assert.deepEqual()", "assert.deepStrictEqual()", "assert.ok()"]

'RegExp' > 'Locked';
// true

I'm not trying to hold this PR up, just lost as to how this ordering occurred and wondering if the other PRs are in an odd order as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, talking about case - I used case-insensitive check. So talking about alphabet, I used case-insensitive one. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It all started with #5003, so I assumed, this is a good way to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, maybe that's me who misunderstands lex and alphabetical order...