Skip to content

Commit

Permalink
[New] add ES2024
Browse files Browse the repository at this point in the history
 - Added:
  - AddValueToKeyedGroup
  - ArrayBufferByteLength
  - ArrayBufferCopyAndDetach
  - GetArrayBufferMaxByteLengthOption
  - GetIteratorFromMethod
  - GetViewByteLength
  - GroupBy
  - HasEitherUnicodeFlag
  - IsArrayBufferViewOutOfBounds
  - IsFixedLengthArrayBuffer
  - IsTypedArrayOutOfBounds
  - IsViewOutOfBounds
  - IteratorStepValue
  - MakeDataViewWithBufferWitnessRecord
  - MakeFullYear
  - MakeTypedArrayWithBufferWitnessRecord
  - MaybeSimpleCaseFolding
  - StringPaddingBuiltinsImpl
  - SystemTimeZoneIdentifier
  - TypedArrayByteLength
  - TypedArrayCreate (see "changed/removed")
  - TypedArrayGetElement
  - TypedArrayLength
  - TypedArraySetElement
  - ValidateAtomicAccessOnIntegerTypedArray

 - Changed/Removed:
  - `this*` AOs renamed to `This*`, or removed
  - `CreateMethodProperty` is removed; see `DefineMethodProperty`
  - `DefaultTimeZone` -> `SystemTimeZoneIdentifier`
  - `GetSubstitution`: fixed to match web reality
  - `ObjectDefineProperties`
  - `ToIndex`: remove unnecessary `ToLength`
  - `ToUint8Clamp`: refactor implementation
  - `StringPad` -> `StringPaddingBuiltinsImpl`; `StringPad` now requires a String fillString
  - `TypedArrayCreate` -> `TypedArrayCreateFromConstructor`
  - `ValidateAtomicAccess`: now takes a "Typed Array With Buffer Witness Record"
  - `ValidateTypedArray`: now requires `order`, and returns a "Typed Array With Buffer Witness Record"

Also, all spec enums are now in all caps.
  • Loading branch information
ljharb committed Jul 12, 2023
1 parent 30f4ce2 commit 1240c37
Show file tree
Hide file tree
Showing 292 changed files with 13,119 additions and 7 deletions.
228 changes: 227 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/es2021.js spackled linguist-generated=true
/es2022.js spackled linguist-generated=true
/es2023.js spackled linguist-generated=true
/es2024.js spackled linguist-generated=true
/2015/AbstractRelationalComparison.js spackled linguist-generated=true
/2015/DateFromTime.js spackled linguist-generated=true
/2015/Day.js spackled linguist-generated=true
Expand Down Expand Up @@ -1367,4 +1368,229 @@
/2023/thisNumberValue.js spackled linguist-generated=true
/2023/thisStringValue.js spackled linguist-generated=true
/2023/thisSymbolValue.js spackled linguist-generated=true
/2023/thisTimeValue.js spackled linguist-generated=true
/2023/thisTimeValue.js spackled linguist-generated=true
/2024/AddEntriesFromIterable.js spackled linguist-generated=true
/2024/AddToKeptObjects.js spackled linguist-generated=true
/2024/AdvanceStringIndex.js spackled linguist-generated=true
/2024/ApplyStringOrNumericBinaryOperator.js spackled linguist-generated=true
/2024/ArrayCreate.js spackled linguist-generated=true
/2024/ArraySetLength.js spackled linguist-generated=true
/2024/ArraySpeciesCreate.js spackled linguist-generated=true
/2024/AsyncFromSyncIteratorContinuation.js spackled linguist-generated=true
/2024/AsyncIteratorClose.js spackled linguist-generated=true
/2024/BigInt/add.js spackled linguist-generated=true
/2024/BigInt/bitwiseAND.js spackled linguist-generated=true
/2024/BigInt/bitwiseNOT.js spackled linguist-generated=true
/2024/BigInt/bitwiseOR.js spackled linguist-generated=true
/2024/BigInt/bitwiseXOR.js spackled linguist-generated=true
/2024/BigInt/divide.js spackled linguist-generated=true
/2024/BigInt/equal.js spackled linguist-generated=true
/2024/BigInt/exponentiate.js spackled linguist-generated=true
/2024/BigInt/index.js spackled linguist-generated=true
/2024/BigInt/leftShift.js spackled linguist-generated=true
/2024/BigInt/lessThan.js spackled linguist-generated=true
/2024/BigInt/multiply.js spackled linguist-generated=true
/2024/BigInt/remainder.js spackled linguist-generated=true
/2024/BigInt/signedRightShift.js spackled linguist-generated=true
/2024/BigInt/subtract.js spackled linguist-generated=true
/2024/BigInt/toString.js spackled linguist-generated=true
/2024/BigInt/unaryMinus.js spackled linguist-generated=true
/2024/BigInt/unsignedRightShift.js spackled linguist-generated=true
/2024/BigIntBitwiseOp.js spackled linguist-generated=true
/2024/BinaryAnd.js spackled linguist-generated=true
/2024/BinaryOr.js spackled linguist-generated=true
/2024/BinaryXor.js spackled linguist-generated=true
/2024/ByteListBitwiseOp.js spackled linguist-generated=true
/2024/ByteListEqual.js spackled linguist-generated=true
/2024/Call.js spackled linguist-generated=true
/2024/CanBeHeldWeakly.js spackled linguist-generated=true
/2024/CanonicalNumericIndexString.js spackled linguist-generated=true
/2024/Canonicalize.js spackled linguist-generated=true
/2024/CharacterRange.js spackled linguist-generated=true
/2024/ClearKeptObjects.js spackled linguist-generated=true
/2024/CloneArrayBuffer.js spackled linguist-generated=true
/2024/CodePointAt.js spackled linguist-generated=true
/2024/CodePointsToString.js spackled linguist-generated=true
/2024/CompareArrayElements.js spackled linguist-generated=true
/2024/CompareTypedArrayElements.js spackled linguist-generated=true
/2024/CompletePropertyDescriptor.js spackled linguist-generated=true
/2024/CompletionRecord.js spackled linguist-generated=true
/2024/CopyDataProperties.js spackled linguist-generated=true
/2024/CreateAsyncFromSyncIterator.js spackled linguist-generated=true
/2024/CreateDataProperty.js spackled linguist-generated=true
/2024/CreateDataPropertyOrThrow.js spackled linguist-generated=true
/2024/CreateHTML.js spackled linguist-generated=true
/2024/CreateIterResultObject.js spackled linguist-generated=true
/2024/CreateListFromArrayLike.js spackled linguist-generated=true
/2024/CreateNonEnumerableDataPropertyOrThrow.js spackled linguist-generated=true
/2024/DateFromTime.js spackled linguist-generated=true
/2024/DateString.js spackled linguist-generated=true
/2024/Day.js spackled linguist-generated=true
/2024/DayFromYear.js spackled linguist-generated=true
/2024/DayWithinYear.js spackled linguist-generated=true
/2024/DaysInYear.js spackled linguist-generated=true
/2024/DefineMethodProperty.js spackled linguist-generated=true
/2024/DefinePropertyOrThrow.js spackled linguist-generated=true
/2024/DeletePropertyOrThrow.js spackled linguist-generated=true
/2024/DetachArrayBuffer.js spackled linguist-generated=true
/2024/EnumerableOwnProperties.js spackled linguist-generated=true
/2024/FindViaPredicate.js spackled linguist-generated=true
/2024/FlattenIntoArray.js spackled linguist-generated=true
/2024/FromPropertyDescriptor.js spackled linguist-generated=true
/2024/Get.js spackled linguist-generated=true
/2024/GetGlobalObject.js spackled linguist-generated=true
/2024/GetIterator.js spackled linguist-generated=true
/2024/GetMatchIndexPair.js spackled linguist-generated=true
/2024/GetMatchString.js spackled linguist-generated=true
/2024/GetMethod.js spackled linguist-generated=true
/2024/GetOwnPropertyKeys.js spackled linguist-generated=true
/2024/GetPromiseResolve.js spackled linguist-generated=true
/2024/GetPrototypeFromConstructor.js spackled linguist-generated=true
/2024/GetStringIndex.js spackled linguist-generated=true
/2024/GetV.js spackled linguist-generated=true
/2024/HasOwnProperty.js spackled linguist-generated=true
/2024/HasProperty.js spackled linguist-generated=true
/2024/HourFromTime.js spackled linguist-generated=true
/2024/InLeapYear.js spackled linguist-generated=true
/2024/InstallErrorCause.js spackled linguist-generated=true
/2024/InstanceofOperator.js spackled linguist-generated=true
/2024/Invoke.js spackled linguist-generated=true
/2024/IsAccessorDescriptor.js spackled linguist-generated=true
/2024/IsArray.js spackled linguist-generated=true
/2024/IsCallable.js spackled linguist-generated=true
/2024/IsCompatiblePropertyDescriptor.js spackled linguist-generated=true
/2024/IsConcatSpreadable.js spackled linguist-generated=true
/2024/IsConstructor.js spackled linguist-generated=true
/2024/IsDataDescriptor.js spackled linguist-generated=true
/2024/IsDetachedBuffer.js spackled linguist-generated=true
/2024/IsExtensible.js spackled linguist-generated=true
/2024/IsGenericDescriptor.js spackled linguist-generated=true
/2024/IsIntegralNumber.js spackled linguist-generated=true
/2024/IsLessThan.js spackled linguist-generated=true
/2024/IsLooselyEqual.js spackled linguist-generated=true
/2024/IsPromise.js spackled linguist-generated=true
/2024/IsPropertyKey.js spackled linguist-generated=true
/2024/IsRegExp.js spackled linguist-generated=true
/2024/IsSharedArrayBuffer.js spackled linguist-generated=true
/2024/IsStrictlyEqual.js spackled linguist-generated=true
/2024/IsStringWellFormedUnicode.js spackled linguist-generated=true
/2024/IsWordChar.js spackled linguist-generated=true
/2024/IteratorClose.js spackled linguist-generated=true
/2024/IteratorComplete.js spackled linguist-generated=true
/2024/IteratorNext.js spackled linguist-generated=true
/2024/IteratorStep.js spackled linguist-generated=true
/2024/IteratorToList.js spackled linguist-generated=true
/2024/IteratorValue.js spackled linguist-generated=true
/2024/KeyForSymbol.js spackled linguist-generated=true
/2024/LengthOfArrayLike.js spackled linguist-generated=true
/2024/MakeDate.js spackled linguist-generated=true
/2024/MakeDay.js spackled linguist-generated=true
/2024/MakeMatchIndicesIndexPairArray.js spackled linguist-generated=true
/2024/MakeTime.js spackled linguist-generated=true
/2024/MinFromTime.js spackled linguist-generated=true
/2024/MonthFromTime.js spackled linguist-generated=true
/2024/NewPromiseCapability.js spackled linguist-generated=true
/2024/NormalCompletion.js spackled linguist-generated=true
/2024/Number/add.js spackled linguist-generated=true
/2024/Number/bitwiseAND.js spackled linguist-generated=true
/2024/Number/bitwiseNOT.js spackled linguist-generated=true
/2024/Number/bitwiseOR.js spackled linguist-generated=true
/2024/Number/bitwiseXOR.js spackled linguist-generated=true
/2024/Number/divide.js spackled linguist-generated=true
/2024/Number/equal.js spackled linguist-generated=true
/2024/Number/exponentiate.js spackled linguist-generated=true
/2024/Number/index.js spackled linguist-generated=true
/2024/Number/leftShift.js spackled linguist-generated=true
/2024/Number/lessThan.js spackled linguist-generated=true
/2024/Number/multiply.js spackled linguist-generated=true
/2024/Number/remainder.js spackled linguist-generated=true
/2024/Number/sameValue.js spackled linguist-generated=true
/2024/Number/sameValueZero.js spackled linguist-generated=true
/2024/Number/signedRightShift.js spackled linguist-generated=true
/2024/Number/subtract.js spackled linguist-generated=true
/2024/Number/toString.js spackled linguist-generated=true
/2024/Number/unaryMinus.js spackled linguist-generated=true
/2024/Number/unsignedRightShift.js spackled linguist-generated=true
/2024/NumberBitwiseOp.js spackled linguist-generated=true
/2024/NumberToBigInt.js spackled linguist-generated=true
/2024/OrdinaryCreateFromConstructor.js spackled linguist-generated=true
/2024/OrdinaryDefineOwnProperty.js spackled linguist-generated=true
/2024/OrdinaryGetOwnProperty.js spackled linguist-generated=true
/2024/OrdinaryGetPrototypeOf.js spackled linguist-generated=true
/2024/OrdinaryHasInstance.js spackled linguist-generated=true
/2024/OrdinaryHasProperty.js spackled linguist-generated=true
/2024/OrdinaryObjectCreate.js spackled linguist-generated=true
/2024/OrdinarySetPrototypeOf.js spackled linguist-generated=true
/2024/OrdinaryToPrimitive.js spackled linguist-generated=true
/2024/ParseHexOctet.js spackled linguist-generated=true
/2024/PromiseResolve.js spackled linguist-generated=true
/2024/QuoteJSONString.js spackled linguist-generated=true
/2024/RegExpCreate.js spackled linguist-generated=true
/2024/RegExpExec.js spackled linguist-generated=true
/2024/RegExpHasFlag.js spackled linguist-generated=true
/2024/RequireObjectCoercible.js spackled linguist-generated=true
/2024/SameValue.js spackled linguist-generated=true
/2024/SameValueNonNumber.js spackled linguist-generated=true
/2024/SameValueZero.js spackled linguist-generated=true
/2024/SecFromTime.js spackled linguist-generated=true
/2024/Set.js spackled linguist-generated=true
/2024/SetFunctionLength.js spackled linguist-generated=true
/2024/SetFunctionName.js spackled linguist-generated=true
/2024/SetIntegrityLevel.js spackled linguist-generated=true
/2024/SortIndexedProperties.js spackled linguist-generated=true
/2024/SpeciesConstructor.js spackled linguist-generated=true
/2024/StringCreate.js spackled linguist-generated=true
/2024/StringGetOwnProperty.js spackled linguist-generated=true
/2024/StringIndexOf.js spackled linguist-generated=true
/2024/StringToBigInt.js spackled linguist-generated=true
/2024/StringToCodePoints.js spackled linguist-generated=true
/2024/StringToNumber.js spackled linguist-generated=true
/2024/SymbolDescriptiveString.js spackled linguist-generated=true
/2024/TestIntegrityLevel.js spackled linguist-generated=true
/2024/ThrowCompletion.js spackled linguist-generated=true
/2024/TimeClip.js spackled linguist-generated=true
/2024/TimeFromYear.js spackled linguist-generated=true
/2024/TimeString.js spackled linguist-generated=true
/2024/TimeWithinDay.js spackled linguist-generated=true
/2024/TimeZoneString.js spackled linguist-generated=true
/2024/ToBigInt.js spackled linguist-generated=true
/2024/ToBigInt64.js spackled linguist-generated=true
/2024/ToBigUint64.js spackled linguist-generated=true
/2024/ToBoolean.js spackled linguist-generated=true
/2024/ToDateString.js spackled linguist-generated=true
/2024/ToInt16.js spackled linguist-generated=true
/2024/ToInt32.js spackled linguist-generated=true
/2024/ToInt8.js spackled linguist-generated=true
/2024/ToIntegerOrInfinity.js spackled linguist-generated=true
/2024/ToLength.js spackled linguist-generated=true
/2024/ToNumber.js spackled linguist-generated=true
/2024/ToNumeric.js spackled linguist-generated=true
/2024/ToObject.js spackled linguist-generated=true
/2024/ToPrimitive.js spackled linguist-generated=true
/2024/ToPropertyDescriptor.js spackled linguist-generated=true
/2024/ToPropertyKey.js spackled linguist-generated=true
/2024/ToString.js spackled linguist-generated=true
/2024/ToUint16.js spackled linguist-generated=true
/2024/ToUint32.js spackled linguist-generated=true
/2024/ToUint8.js spackled linguist-generated=true
/2024/ToZeroPaddedDecimalString.js spackled linguist-generated=true
/2024/TrimString.js spackled linguist-generated=true
/2024/Type.js spackled linguist-generated=true
/2024/TypedArrayElementSize.js spackled linguist-generated=true
/2024/UTF16EncodeCodePoint.js spackled linguist-generated=true
/2024/UTF16SurrogatePairToCodePoint.js spackled linguist-generated=true
/2024/UnicodeEscape.js spackled linguist-generated=true
/2024/ValidateAndApplyPropertyDescriptor.js spackled linguist-generated=true
/2024/WeakRefDeref.js spackled linguist-generated=true
/2024/WeekDay.js spackled linguist-generated=true
/2024/WordCharacters.js spackled linguist-generated=true
/2024/YearFromTime.js spackled linguist-generated=true
/2024/abs.js spackled linguist-generated=true
/2024/clamp.js spackled linguist-generated=true
/2024/floor.js spackled linguist-generated=true
/2024/max.js spackled linguist-generated=true
/2024/min.js spackled linguist-generated=true
/2024/modulo.js spackled linguist-generated=true
/2024/msFromTime.js spackled linguist-generated=true
/2024/substring.js spackled linguist-generated=true
/2024/truncate.js spackled linguist-generated=true
45 changes: 45 additions & 0 deletions 2024/AddEntriesFromIterable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions 2024/AddToKeptObjects.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions 2024/AddValueToKeyedGroup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use strict';

var $TypeError = require('es-errors/type');

var callBound = require('call-bind/callBound');

var $push = callBound('Array.prototype.push');

var SameValue = require('./SameValue');

var IsArray = require('../helpers/IsArray');
var every = require('../helpers/every');
var forEach = require('../helpers/forEach');

var hasOwn = require('hasown');

var isKeyedGroup = function (group) {
return hasOwn(group, '[[Keys]]')
&& hasOwn(group, '[[Elements]]')
&& IsArray(group['[[Elements]]']);
};

// https://tc39.es/ecma262/#sec-add-value-to-keyed-group

module.exports = function AddValueToKeyedGroup(groups, key, value) {
if (!IsArray(groups) || !every(groups, isKeyedGroup)) {
throw new $TypeError('Assertion failed: `groups` must be a List of Records with [[Key]] and [[Elements]]');
}

var matched = 0;
forEach(groups, function (g) { // step 1
if (SameValue(g['[[Key]]'], key)) { // step 2
matched += 1;
if (matched > 1) {
throw new $TypeError('Assertion failed: Exactly one element of groups meets this criterion'); // step 2.a
}

$push(g['[[Elements]]'], value); // step 2.b
}
});

var group = { '[[Key]]': key, '[[Elements]]': [value] }; // step 2

$push(groups, group); // step 3
};
31 changes: 31 additions & 0 deletions 2024/AdvanceStringIndex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1240c37

Please sign in to comment.