ECMA-262 ECMAScript® Language Specification
repository·main·Indexed 12 days ago
https://github.com/tc39/ecma262The official source and current draft of the ECMA-262 ECMAScript Language Specification, used to generate the standard for developers worldwide. Includes the @tc39/ecma262-biblio package for machine-readable terms, clauses, grammar, and abstract operations.
What's inside ECMAScript
- New language features follow the TC39 process and are tracked in a separate repository. You can check the status of proposals (Finished, Active, Stage 1, Stage 0, or Inactive) in the proposals repository.
Understand why imported module bindings are aliased instead of copied
mainIn ECMAScript modules,
importstatements create an alias to a remote binding rather than creating a new local copy. This design is critical for supporting cyclic module dependencies.If bindings were copied, a module involved in a cycle would receive a copy of an uninitialized value before the dependency has finished evaluating. By using aliases, the engine can create an empty binding first, allow the modules to finish loading, and then 'fill in' the value of that binding once the exporting module has been evaluated, ensuring the alias points to the correct, initialized value.
// Even.js import {isOdd} from "./Odd.js"; export function isEven(num) { if (num === 0) { return true; } else { return isOdd(num - 1); } }// Odd.js import {isEven} from "./Even.js"; export function isOdd(num) { if (num === 0) { return false; } else { return isEven(num - 1); } }// main.js import {isOdd} from "./Odd"; isOdd(2);Why import statements do not use destructuring syntax
mainWhileimportstatements look similar to destructuring, they do not use real destructuring syntax because they create an alias of a remote binding rather than creating new local bindings. First-class destructuring is designed to create new bindings from substructures of objects or arrays, which is fundamentally different from the aliasing mechanism required by the module system.Propose a new ECMAScript feature
mainNew features must be proposed to the TC39 committee and championed (or co-championed) by at least one committee member. Once raised at a committee meeting, the proposal enters Stage 0. For detailed information on the progression through stages, refer to the official proposal process documentation.View the human-readable ECMAScript specification
mainThe source code in this repository is processed into a human-readable version of the ECMA-262 Language Specification. You can view the current draft online at the official TC39 website.
https://tc39.es/ecma262/Install and use @tc39/ecma262-biblio with ecmarkup
mainThe
@tc39/ecma262-bibliopackage provides a machine-readable representation of ECMA-262 terms, clauses, grammar, and abstract operations. If you are usingecmarkupand want to load this bibliography, add it as a dependency to your project and use the--load-biblioflag.Warning: This package is inherently unstable because it is updated alongside the specification. Editorial changes in ECMA-262 can modify the bibliography, potentially breaking builds (especially when using
--lint-spec --strict). To prevent unexpected breakage, you should pin a precise version of this package rather than relying on semver ranges.# Example usage with ecmarkup ecmarkup --load-biblio @tc39/ecma262-biblio <other-flags>Set up the specification development environment
mainTo build the specification from source, follow these steps after cloning the repository:
- Install dependencies:
npm install - Build the spec:
npm run build - (Optional) Set up continuous builds:
npm run watch
The build output is located in the
outdirectory. To remove the build artifacts, runnpm run clean.npm install npm run build # or for continuous builds npm run watch # to clean output npm run clean- Install dependencies: