@@ -31,6 +31,7 @@ const {
3131} = primordials ;
3232
3333const {
34+ converters : sharedConverters ,
3435 makeException,
3536 createEnumConverter,
3637 createSequenceConverter,
@@ -43,11 +44,10 @@ const {
4344} = require ( 'internal/util' ) ;
4445const { CryptoKey } = require ( 'internal/crypto/webcrypto' ) ;
4546const {
46- getDataViewOrTypedArrayBuffer,
4747 validateMaxBufferLength,
4848 kNamedCurveAliases,
4949} = require ( 'internal/crypto/util' ) ;
50- const { isArrayBuffer , isSharedArrayBuffer } = require ( 'internal/util/types' ) ;
50+ const { isSharedArrayBuffer } = require ( 'internal/util/types' ) ;
5151
5252// https://tc39.es/ecma262/#sec-tonumber
5353function toNumber ( value , opts = kEmptyObject ) {
@@ -193,8 +193,6 @@ converters.object = (V, opts) => {
193193 return V ;
194194} ;
195195
196- const isNonSharedArrayBuffer = isArrayBuffer ;
197-
198196/**
199197 * @param {string | object } V - The hash algorithm identifier (string or object).
200198 * @param {string } label - The dictionary name for the error message.
@@ -223,25 +221,7 @@ converters.Uint8Array = (V, opts = kEmptyObject) => {
223221 return V ;
224222} ;
225223
226- converters . BufferSource = ( V , opts = kEmptyObject ) => {
227- if ( ArrayBufferIsView ( V ) ) {
228- if ( isSharedArrayBuffer ( getDataViewOrTypedArrayBuffer ( V ) ) ) {
229- throw makeException (
230- 'is a view on a SharedArrayBuffer, which is not allowed.' ,
231- opts ) ;
232- }
233-
234- return V ;
235- }
236-
237- if ( ! isNonSharedArrayBuffer ( V ) ) {
238- throw makeException (
239- 'is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.' ,
240- opts ) ;
241- }
242-
243- return V ;
244- } ;
224+ converters . BufferSource = sharedConverters . BufferSource ;
245225
246226converters [ 'sequence<DOMString>' ] = createSequenceConverter (
247227 converters . DOMString ) ;
0 commit comments