* Sets a new value for the property. * @param {any} value - The new value to be set. * @throws {Error} If the property is not writable.
(value)
| 353 | * @throws {Error} If the property is not writable. |
| 354 | */ |
| 355 | mockImplementation(value) { |
| 356 | if (!this.#descriptor.writable) { |
| 357 | throw new ERR_INVALID_ARG_VALUE( |
| 358 | 'propertyName', this.#propertyName, 'cannot be set', |
| 359 | ); |
| 360 | } |
| 361 | const nextValue = this.#getAccessValue(value); |
| 362 | const access = { |
| 363 | __proto__: null, |
| 364 | type: 'set', |
| 365 | value: nextValue, |
| 366 | // eslint-disable-next-line no-restricted-syntax |
| 367 | stack: new Error(), |
| 368 | }; |
| 369 | ArrayPrototypePush(this.#accesses, access); |
| 370 | this.#value = nextValue; |
| 371 | } |
| 372 | |
| 373 | #getAccessValue(value) { |
| 374 | const accessIndex = this.#accesses.length; |
nothing calls this directly
no test coverage detected