@@ -386,7 +386,6 @@ function convertToInt(
386386 if ( V >= upperBound ) {
387387 return upperBound === 0 ? 0 : upperBound ;
388388 }
389- return evenRound ( V ) ;
390389 }
391390 x = V ;
392391 } else {
@@ -623,15 +622,24 @@ function createEnumConverter(name, values) {
623622
624623/**
625624 * Returns the context used when converting a dictionary member.
626- * @param {string } dictionaryName Dictionary identifier.
627625 * @param {string } key Dictionary member identifier.
628626 * @param {ConversionOptions } options Conversion options.
629627 * @returns {string }
630628 */
631- function dictionaryMemberContext ( dictionaryName , key , options ) {
629+ function dictionaryMemberContext ( key , options ) {
632630 return options . context ? `${ key } in ${ options . context } ` : key ;
633631}
634632
633+ /**
634+ * Returns the context used when converting a sequence element.
635+ * @param {number } index Sequence element index.
636+ * @param {ConversionOptions } options Conversion options.
637+ * @returns {string }
638+ */
639+ function sequenceElementContext ( index , options ) {
640+ return `${ options . context ?? 'Value' } [${ index } ]` ;
641+ }
642+
635643/**
636644 * Returns the message used for a missing required dictionary member.
637645 * @param {string } dictionaryName Dictionary identifier.
@@ -692,7 +700,7 @@ function createDictionaryConverter(
692700 {
693701 __proto__ : null ,
694702 ...options ,
695- context : dictionaryMemberContext ( dictionaryName , key , options ) ,
703+ context : dictionaryMemberContext ( key , options ) ,
696704 } ,
697705 ) ;
698706 // Validators are a Node.js extension after conversion. They let
@@ -770,7 +778,7 @@ function createSequenceConverter(converter) {
770778 const idlValue = converter ( next . value , {
771779 __proto__ : null ,
772780 ...options ,
773- context : ` ${ options . context } [ ${ idlSequence . length } ]` ,
781+ context : sequenceElementContext ( idlSequence . length , options ) ,
774782 } ) ;
775783 // Step 3.4: store the value and advance i.
776784 ArrayPrototypePush ( idlSequence , idlValue ) ;
@@ -823,6 +831,7 @@ function validateBufferSourceBacking(buffer, options) {
823831 // ArrayBuffer.prototype.resizable is an ArrayBuffer brand check and the
824832 // [AllowResizable] value we need. For SharedArrayBuffer-backed views it
825833 // throws, which lets this path avoid a separate IsSharedArrayBuffer check.
834+ // Keep this in sync with the inlined BufferSource view branch below.
826835 resizable = ArrayBufferPrototypeGetResizable ( buffer ) ;
827836 } catch {
828837 // ArrayBufferView conversion step 2: reject SharedArrayBuffer
@@ -921,6 +930,7 @@ converters.BufferSource = (V, options = kEmptyObject) => {
921930 // Keep this logic inline instead of calling validateBufferSourceBacking().
922931 // BufferSource conversion is hot, and this avoids a helper call while still
923932 // using a primordial getter for the backing-buffer internal-slot check.
933+ // Keep this in sync with validateBufferSourceBacking().
924934 let resizable ;
925935 try {
926936 // ArrayBuffer.prototype.resizable is both the ArrayBuffer brand check
0 commit comments