diff --git a/index.html b/index.html index 7a8876e..274620f 100644 --- a/index.html +++ b/index.html @@ -135,7 +135,7 @@ }; Search.prototype.documentKeydown = function (e) { - if (e.keyCode === 191) { + if (e.key === '/') { e.preventDefault(); e.stopPropagation(); this.triggerSearch(); @@ -1061,7 +1061,7 @@ if (name === 'textarea' || name === 'input' || name === 'select' || target.isContentEditable) { return; } - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + if (e.altKey || e.ctrlKey || e.metaKey) { return; } if (e.key === 'm' && usesMultipage) { @@ -1083,6 +1083,8 @@ } } else if (e.key === 'u') { document.documentElement.classList.toggle('show-ao-annotations'); + } else if (e.key === '?') { + document.getElementById('shortcuts-help').classList.toggle('active'); } } @@ -1098,8 +1100,11 @@ document.addEventListener( 'keydown', debounce(e => { - if (e.code === 'Escape' && Toolbox.active) { - Toolbox.deactivate(); + if (e.code === 'Escape') { + if (Toolbox.active) { + Toolbox.deactivate(); + } + document.getElementById('shortcuts-help').classList.remove('active'); } }) ); @@ -2359,10 +2364,57 @@ .clause-attributes-tag a { color: #884400; } -

When the groupByToMap method is called with one or two arguments, the following steps are taken:

-
  1. Let O be ? ToObject(this value).
  2. Let len be ? LengthOfArrayLike(O).
  3. If IsCallable(callbackfn) is false, throw a TypeError exception.
  4. Let k be 0.
  5. Let groups be a new empty List.
  6. Repeat, while k < len
    1. Let Pk be ! ToString(๐”ฝ(k)).
    2. Let kValue be ? Get(O, Pk).
    3. Let key be ? Call(callbackfn, thisArg, ยซ kValue, ๐”ฝ(k), O ยป).
    4. If key is -0๐”ฝ, set key to +0๐”ฝ.
    5. Perform ! AddValueToKeyedGroup(groups, key, kValue).
    6. Set k to k + 1.
  7. Let map be ! Construct(%Map%).
  8. For each Record { [[Key]], [[Elements]] } g of groups, do
    1. Let elements be ! CreateArrayFromList(g.[[Elements]]).
    2. Let entry be the Record { [[Key]]: g.[[Key]], [[Value]]: elements }.
    3. Append entry as the last element of map.[[MapData]].
  9. Return map.
+
  1. Let O be ? ToObject(this value).
  2. Let len be ? LengthOfArrayLike(O).
  3. If IsCallable(callbackfn) is false, throw a TypeError exception.
  4. Let k be 0.
  5. Let groups be a new empty List.
  6. Repeat, while k < len
    1. Let Pk be ! ToString(๐”ฝ(k)).
    2. Let kValue be ? Get(O, Pk).
    3. Let key be ? Call(callbackfn, thisArg, ยซ kValue, ๐”ฝ(k), O ยป).
    4. If key is -0๐”ฝ, set key to +0๐”ฝ.
    5. Perform AddValueToKeyedGroup(groups, key, kValue).
    6. Set k to k + 1.
  7. Let map be ! Construct(%Map%).
  8. For each Record { [[Key]], [[Elements]] } g of groups, do
    1. Let elements be CreateArrayFromList(g.[[Elements]]).
    2. Let entry be the Record { [[Key]]: g.[[Key]], [[Value]]: elements }.
    3. Append entry as the last element of map.[[MapData]].
  9. Return map.
Note 2

The groupByToMap function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method.

@@ -2413,15 +2465,15 @@

2.2 Array.prototype.groupByToMap ( callback

2.3 AddValueToKeyedGroup ( groups, key, value )

-

The abstract operation AddValueToKeyedGroup takes arguments groups (a List of Records that have [[Key]] and [[Elements]] fields), key (an ECMAScript language value), and value (an ECMAScript language value). It performs the following steps when called:

-
  1. For each Record { [[Key]], [[Elements]] } g of groups, do
    1. If ! SameValue(g.[[Key]], key) is true, then
      1. Assert: exactly one element of groups meets this criteria.
      2. Append value as the last element of g.[[Elements]].
      3. Return.
  2. Let group be the Record { [[Key]]: key, [[Elements]]: ยซ value ยป }.
  3. Append group as the last element of groups.
+

The abstract operation AddValueToKeyedGroup takes arguments groups (a List of Records that have [[Key]] and [[Elements]] fields), key (an ECMAScript language value), and value (an ECMAScript language value) and returns unused. It performs the following steps when called:

+
  1. For each Record { [[Key]], [[Elements]] } g of groups, do
    1. If SameValue(g.[[Key]], key) is true, then
      1. Assert: exactly one element of groups meets this criteria.
      2. Append value as the last element of g.[[Elements]].
      3. Return unused.
  2. Let group be the Record { [[Key]]: key, [[Elements]]: ยซ value ยป }.
  3. Append group as the last element of groups.
  4. Return unused.

2.4 Array.prototype [ @@unscopables ]

The initial value of the @@unscopables data property is an object created by the following steps:

-
  1. Let unscopableList be ! OrdinaryObjectCreate(null).
  2. Perform ! CreateDataPropertyOrThrow(unscopableList, "at", true).
  3. Perform ! CreateDataPropertyOrThrow(unscopableList, "copyWithin", true).
  4. Perform ! CreateDataPropertyOrThrow(unscopableList, "entries", true).
  5. Perform ! CreateDataPropertyOrThrow(unscopableList, "fill", true).
  6. Perform ! CreateDataPropertyOrThrow(unscopableList, "find", true).
  7. Perform ! CreateDataPropertyOrThrow(unscopableList, "findIndex", true).
  8. Perform ! CreateDataPropertyOrThrow(unscopableList, "flat", true).
  9. Perform ! CreateDataPropertyOrThrow(unscopableList, "flatMap", true).
  10. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupBy", true).
  11. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupByToMap", true).
  12. Perform ! CreateDataPropertyOrThrow(unscopableList, "includes", true).
  13. Perform ! CreateDataPropertyOrThrow(unscopableList, "keys", true).
  14. Perform ! CreateDataPropertyOrThrow(unscopableList, "values", true).
  15. Return unscopableList.
+
  1. Let unscopableList be OrdinaryObjectCreate(null).
  2. Perform ! CreateDataPropertyOrThrow(unscopableList, "at", true).
  3. Perform ! CreateDataPropertyOrThrow(unscopableList, "copyWithin", true).
  4. Perform ! CreateDataPropertyOrThrow(unscopableList, "entries", true).
  5. Perform ! CreateDataPropertyOrThrow(unscopableList, "fill", true).
  6. Perform ! CreateDataPropertyOrThrow(unscopableList, "find", true).
  7. Perform ! CreateDataPropertyOrThrow(unscopableList, "findIndex", true).
  8. Perform ! CreateDataPropertyOrThrow(unscopableList, "flat", true).
  9. Perform ! CreateDataPropertyOrThrow(unscopableList, "flatMap", true).
  10. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupBy", true).
  11. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupByToMap", true).
  12. Perform ! CreateDataPropertyOrThrow(unscopableList, "includes", true).
  13. Perform ! CreateDataPropertyOrThrow(unscopableList, "keys", true).
  14. Perform ! CreateDataPropertyOrThrow(unscopableList, "values", true).
  15. Return unscopableList.

This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.

Note

The own property names of this object are property names that were not included as standard properties of Array.prototype prior to the ECMAScript 2015 specification. These names are ignored for with statement binding purposes in order to preserve the behaviour of existing code that might use one of these names as a binding in an outer scope that is shadowed by a with statement whose binding object is an Array.

diff --git a/spec.emu b/spec.emu index 23b343f..fe13637 100644 --- a/spec.emu +++ b/spec.emu @@ -43,11 +43,11 @@ location: https://tc39.es/proposal-array-grouping/ 1. Let _Pk_ be ! ToString(๐”ฝ(_k_)). 1. Let _kValue_ be ? Get(_O_, _Pk_). 1. Let _propertyKey_ be ? ToPropertyKey(? Call(_callbackfn_, _thisArg_, « _kValue_, ๐”ฝ(_k_), _O_ »)). - 1. Perform ! AddValueToKeyedGroup(_groups_, _propertyKey_, _kValue_). + 1. Perform AddValueToKeyedGroup(_groups_, _propertyKey_, _kValue_). 1. Set _k_ to _k_ + 1. - 1. Let _obj_ be ! OrdinaryObjectCreate(*null*). + 1. Let _obj_ be OrdinaryObjectCreate(*null*). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do - 1. Let _elements_ be ! CreateArrayFromList(_g_.[[Elements]]). + 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). 1. Perform ! CreateDataPropertyOrThrow(_obj_, _g_.[[Key]], _elements_). 1. Return _obj_. @@ -80,11 +80,11 @@ location: https://tc39.es/proposal-array-grouping/ 1. Let _kValue_ be ? Get(_O_, _Pk_). 1. Let _key_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, ๐”ฝ(_k_), _O_ »). 1. If _key_ is *-0*๐”ฝ, set _key_ to *+0*๐”ฝ. - 1. Perform ! AddValueToKeyedGroup(_groups_, _key_, _kValue_). + 1. Perform AddValueToKeyedGroup(_groups_, _key_, _kValue_). 1. Set _k_ to _k_ + 1. 1. Let _map_ be ! Construct(%Map%). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do - 1. Let _elements_ be ! CreateArrayFromList(_g_.[[Elements]]). + 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). 1. Let _entry_ be the Record { [[Key]]: _g_.[[Key]], [[Value]]: _elements_ }. 1. Append _entry_ as the last element of _map_.[[MapData]]. 1. Return _map_. @@ -100,18 +100,19 @@ location: https://tc39.es/proposal-array-grouping/ _groups_: a List of Records that have [[Key]] and [[Elements]] fields, _key_: an ECMAScript language value, _value_: an ECMAScript language value, - ) + ): ~unused~

1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do - 1. If ! SameValue(_g_.[[Key]], _key_) is *true*, then + 1. If SameValue(_g_.[[Key]], _key_) is *true*, then 1. Assert: exactly one element of _groups_ meets this criteria. 1. Append _value_ as the last element of _g_.[[Elements]]. - 1. Return. + 1. Return ~unused~. 1. Let _group_ be the Record { [[Key]]: _key_, [[Elements]]: « _value_ » }. 1. Append _group_ as the last element of _groups_. + 1. Return ~unused~. @@ -120,7 +121,7 @@ location: https://tc39.es/proposal-array-grouping/

Array.prototype [ @@unscopables ]

The initial value of the @@unscopables data property is an object created by the following steps:

- 1. Let _unscopableList_ be ! OrdinaryObjectCreate(*null*). + 1. Let _unscopableList_ be OrdinaryObjectCreate(*null*). 1. Perform ! CreateDataPropertyOrThrow(_unscopableList_, *"at"*, *true*). 1. Perform ! CreateDataPropertyOrThrow(_unscopableList_, *"copyWithin"*, *true*). 1. Perform ! CreateDataPropertyOrThrow(_unscopableList_, *"entries"*, *true*).