tc39 / ecma262

Status, process, and documents for ECMA-262
https://tc39.es/ecma262/
Other
14.84k stars 1.26k forks source link

Documenting editorial conventions #2236

Open bakkot opened 3 years ago

bakkot commented 3 years ago

The editors should write down editorial conventions for the benefit of contributors and future editors, perhaps in tc39/how-we-work.

I've tried to automatically enforce some of them in ecmarkup. But there's plenty of others. Let's use this issue to collect them for now.

michaelficarra commented 3 years ago

Might be a good use of GitHub's wiki feature? They can be configured so that only maintainers can make edits.

bakkot commented 3 years ago

Here's a good one: under what circumstances do we pre-declare our aliases? See e.g. https://github.com/tc39/ecma262/pull/1908#discussion_r395920968, https://github.com/tc39/ecma262/pull/2221#discussion_r543987103.

bakkot commented 2 years ago

As of #2547, we should also include the rules for completion records: use of ! / ? / Completion(...) for calls of completion-record-returning AOs, non-use of those things for non-completion-record-returning AOs.

michaelficarra commented 2 years ago

We prefer spec enums over strings/constructors/instrinsics where they are just being switched over (aka used as an enum). See https://github.com/tc39/ecma402/pull/689

bakkot commented 1 year ago

We generally do validation first, then the happy path. So e.g. 1. If not in range, throw. 2. Return value., rather than 1. If in range, return value. 2. Throw.

michaelficarra commented 1 month ago

I've started work on this here: https://github.com/tc39/ecma262/wiki/Editorial-Conventions