* Validates the [AllowResizable] constraint for growable SharedArrayBuffer. * @param {SharedArrayBuffer} buffer SharedArrayBuffer backing buffer. * @param {ConversionOptions} options Conversion options. * @returns {void}
(buffer, options)
| 897 | * @returns {void} |
| 898 | */ |
| 899 | function validateAllowGrowableSharedArrayBuffer(buffer, options) { |
| 900 | // SharedArrayBuffer and ArrayBufferView conversion step 3: |
| 901 | // IsFixedLengthArrayBuffer(buffer) must be true without [AllowResizable]. |
| 902 | // Do not use a primordial getter here. When this module is included in the |
| 903 | // startup snapshot, an early-captured SharedArrayBuffer.prototype.growable |
| 904 | // getter does not detect growable buffers created after deserialization. |
| 905 | // Lazily capturing the getter would work, but it would observe the runtime |
| 906 | // prototype at first comparison, so it would not be an actual primordial. |
| 907 | if (!options.allowResizable && buffer.growable) { |
| 908 | throw makeException( |
| 909 | 'is backed by a growable SharedArrayBuffer, which is not allowed.', |
| 910 | options); |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | /** |
| 915 | * Validates the [AllowResizable] constraint for resizable ArrayBuffer. |
no test coverage detected
searching dependent graphs…