* Validates the [AllowResizable] constraint for resizable ArrayBuffer. * @param {boolean} resizable ArrayBuffer [[ArrayBufferResizable]] value. * @param {ConversionOptions} options Conversion options. * @returns {void}
(resizable, options)
| 918 | * @returns {void} |
| 919 | */ |
| 920 | function 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. |
no test coverage detected
searching dependent graphs…