google / google/closure-compiler

ES6 export keys need to be sorted

Open
#2,790 0 comments 0 reactions 0 assignees View on GitHub
ES6 Modules
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

[Per the spec, modules have an [[Exports]] slot that is sorted:](https://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects)

> A List containing the String values of the exported names exposed as own properties of this object. The list is ordered as if an Array of those String values had been sorted using Array.prototype.sort using SortCompare as comparefn.

[And enumerating over a module iterates over this list:](https://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-enumerate)

> When the [[Enumerate]] internal method of a module namespace exotic object O is called the following steps are taken:
>
> Let exports be the value of O’s [[Exports]] internal slot.
> Return CreateListIterator(exports).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.