# Ecma TC39 January 2021 agenda overview Ecma Technical Committee 39 ([TC39](https://www.ecma-international.org/memento/tc39.htm)) is the group responsible for standardizing JavaScript as a formal "ECMAScript" specification, and generally releases a new edition every year. Substantial changes are managed at "plenary" meetings involving delegates of member organizations (including the OpenJS Foundation!). The first meeting of 2021 is taking place this week, and here's a sampling of major items on the [agenda](https://github.com/tc39/agendas/blob/master/2021/01.md), grouped by how close they are to inclusion according to the documented [four-stage process](https://tc39.es/process-document/). Feel free to reach out if you want your voice to be heard regarding any of these. [TOC] # Stage 3 A "Candidate" proposal is added to the working draft for the next edition after [tests](https://github.com/tc39/test262) are ready, at least two independent implementations in browsers and/or Node.js and/or other engines pass them, and the committee approves it. ## Array/indexable relative indexing (`arr.at(index)`) https://github.com/tc39/proposal-relative-indexing-method proposes introducing an `at` method on array and other indexable types for retrieving an item at arbitrary index, with negative values interpreted from the end as in `slice` and DOM method `item` (e.g., `"abcdef".at(-2)` is "e"). It is seeking advancement to Stage 4. ## Regular expression match indices (`re.exec(s).indices`) https://github.com/tc39/proposal-regexp-match-indices proposes adding substring indices to match objects for regular expressions with a new `d` flag, e.g. `/ba.\s*/.exec("foo bar baz").indices` is `[[4,8], [8,11]]`. It is not seeking advancement. ## Localized datetime range formatting (`dtf.formatRange(start, end)`) https://github.com/tc39/proposal-intl-DateTimeFormat-formatRange proposes adding `formatRange` and `formatRangeToParts` methods to DateTimeFormat instances for localizing date–time intervals such as travel reservations or calendar events (e.g., `(new Intl.DateTimeFormat("en", {month: 'short', day: 'numeric'})).formatRange(start, end)` might result in "Jan 25 – 28"). It is seeking advancement to Stage 4. # Stage 2 A "Draft" proposal advances to Stage 3 after spec text is complete, reviewers sign off, and the committee approves it. ## JSON modules (`assert {type: "json"}`) https://github.com/tc39/proposal-json-modules/ proposes a means of forcing an imported module to be interpreted as JSON rather than Javascript, e.g. `import config from "./config.json" assert { type: "json" }`. It is seeking advancement to Stage 3. ## `Array.isTemplateObject` https://github.com/tc39/proposal-array-is-template-object proposes a function so functions can determine when their input came from a template string rather than explicit arguments, for differentiating "trusted" static input from untrusted potentially malicious data (e.g., ```safeDynamicUrl = urlWithParams`https://example.com/api?param=${value}`;```). It is seeking advancement to Stage 3. ## Temporal https://github.com/tc39/proposal-temporal proposes a "Temporal" collection of classes for supporting convenient and correct use of dates and times. In anticipation of a request for advancement later this year, the champions are presenting an update. ## Class `static {…}` initialization blocks https://github.com/tc39/proposal-class-static-block proposes a mechanism to perform additional static initialization at the end of class definition evaluation with access to private state: ```js let assertInstanceOfC; class C { static x = {…}; static y; static z; #isC static { const derived = deriveFrom(this.x); this.y = derived.y; this.z = derived.z; assertInstanceOfC = v => {v.#isC; return true}; } … } ``` It is seeking advancement to Stage 3. ## Resizeable array buffers https://github.com/tc39/proposal-resizablearraybuffer proposes the introduction of `ResizableArrayBuffer` and `GrowableSharedArrayBuffer` types for better web interoperability with e.g. WebAssembly and WebGPU. It is not seeking advancement. ## Realms https://github.com/tc39/proposal-realms proposes a way to construct new "realms" with their own independent collections of intrinsic objects, similar to iframe windows and Node.js [`vm`](https://nodejs.org/api/vm.html) contexts. It is not seeking advancement. ## Ergonomic private field checks (`#privateField in obj`) https://github.com/tc39/proposal-private-fields-in-in proposes new syntax to improve the ergonomics of checking for the presence of a private field. It is seeking advancement to Stage 3. # Stage 1 A "Proposal" advances to Stage 2 after draft spec text is ready and the committee approves it. ## More Intl locale information (`textInfo`, `weekInfo`, `defaults`, etc.) https://github.com/tc39/proposal-intl-locale-info proposes exposing more information in objects returned from `new Intl.Locale(…)`, including conventions around text direction, unit systems, and how days of the week are treated, along with default configuration for Intl APIs (e.g., `new Intl.Locale("en-US").defaults.calendar` is "gregory"). It is seeking advancement to Stage 2. ## Intl.DisplayNames v2 https://github.com/tc39/intl-displaynames-v2 proposes extending `Intl.DisplayNames` to localize the names of units and calendar systems. It is seeking advancement to Stage 2. ## Dynamic Code Brand Checks (selective `eval`) https://github.com/tc39/proposal-dynamic-code-brand-checks proposes allow hosts to support opt-in selective use of `eval` with only "trusted" static input. It is seeking advancement to Stage 2. ## `module {…}` blocks https://github.com/tc39/proposal-js-module-blocks proposes syntax for inline definition of importable and transferable module objects, e.g. `worker.postMessage(module { export default async function expensive(){…}; })`. It is seeking advancement to Stage 2. ## `do {…}` expressions https://github.com/bakkot/do-expressions-v2 proposes introducing a new block-valued expression that propagates the last completion value of a contained statement, e.g. ```js let sloppyCartesianQuadrant = do { if (Math.sqrt(x*x + y*y) <= originRadius) { 0 } else if (x > 0 && y >= 0) { 1 } else if (x <= 0 && y > 0) { 2 } else if (x < 0 && y <= 0) { 3 } else if (x >= 0 && y < 0) { 4 } else { throw new RangeError(…) } }; ``` It is seeking advancement to Stage 2. # Stage 0 A "Strawperson" advances to Stage 1 after the committee acknowledges a problem, identifies a "champion" to shepherd its solution, and takes ownership of the corresponding repository. ## `async do {…}` expressions https://github.com/bakkot/proposal-async-do-expressions proposes introducing syntax for introducing a new asynchronous context, supporting replacement of relatively cumbersome constructs such as `(async () => {…})()` with `async do {…}`. ## Array find from end (`findLast`) https://github.com/Kingwl/proposal-array-find-from-last proposes `findLast` and `findLastIndex` Array prototype methods. ## Index from end https://github.com/hax/proposal-index-from-end proposes "negative indexing" with new syntax, tentatively `arr[^i]` as sugar for `arr[arr.length - i]`. ## Set notation in regular expression character classes https://github.com/mathiasbynens/proposal-regexp-set-notation proposes extending regular expression character classes to support set operations as available for [Unicode regular expressions](https://www.unicode.org/reports/tr18/#Subtraction_and_Intersection), such as "non-ASCII digits", "lowercase letters", or "emoji in the Basic Multilingual Plane". ## Extend Intl.DateTimeFormat `timeZoneName` https://github.com/FrankYFTang/proposal-intl-extend-timezonename/ proposes adding new options for the Intl.DateTimeFormat `timeZoneName` option to localize time zone as a UTC offset (e.g., "longGMT" for "GMT-0800" and "shortGMT" for "GMT-8") or a colloquial name (e.g., "longWall" for "Pacific Time" and "shortWall" for "PT"). ## Intl.DateTimeFormat `eraDisplay` https://github.com/Louis-Aime/proposal-intl-eradisplay proposes improving Intl.DateTimeFormat to improve the rendering of dates whose era may differ from the "current" era (e.g., `(new Intl.DateTimeFormat("en-US", {year: "numeric"})).format(new Date(-752, 3, 13))` might result in "753 BC"). ## Locale matching https://github.com/longlho/proposal-intl-localematcher proposes adding `Intl.LocaleMatcher` to expose and extend the existing operation that determines which available locale is most useful with a given collection of requested locales (from e.g. an Accept-Language HTTP header field). ## Class brand check https://github.com/hax/proposal-class-brand-check proposes a meta-method for `instanceof`-like testing if a value has a "brand" marking it as an instance of a class. ## Deferred/lazy module evaluation https://github.com/codehag/proposal-defer-import-eval proposes allowing authors-specified "lazy" import of modules that defers their evaluation until first use via proposed syntax like `import * as expensive from "…" with { lazyInit: true }` or `lazy import * as expensive from "…"`.