MCPcopy Index your code
hub / github.com/nodejs/node / validateAllowResizableArrayBuffer

Function validateAllowResizableArrayBuffer

lib/internal/webidl.js:920–930  ·  view source on GitHub ↗

* Validates the [AllowResizable] constraint for resizable ArrayBuffer. * @param {boolean} resizable ArrayBuffer [[ArrayBufferResizable]] value. * @param {ConversionOptions} options Conversion options. * @returns {void}

(resizable, options)

Source from the content-addressed store, hash-verified

918 * @returns {void}
919 */
920function validateAllowResizableArrayBuffer(resizable, options) {
921 // ArrayBuffer and ArrayBufferView conversion step 3:
922 // IsFixedLengthArrayBuffer(buffer) must be true without [AllowResizable].
923 // Read [[ArrayBufferResizable]] first so fixed buffers skip the options
924 // property lookup on this hot path.
925 if (resizable && !options.allowResizable) {
926 throw makeException(
927 'is backed by a resizable ArrayBuffer, which is not allowed.',
928 options);
929 }
930}
931
932/**
933 * Converts a JavaScript value to the IDL Uint8Array type.

Callers 2

webidl.jsFile · 0.85

Calls 1

makeExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…