(callback, { preserveReturnValue = false } = kEmptyObject)
| 573 | } |
| 574 | |
| 575 | function once(callback, { preserveReturnValue = false } = kEmptyObject) { |
| 576 | let called = false; |
| 577 | let returnValue; |
| 578 | return function(...args) { |
| 579 | if (called) return returnValue; |
| 580 | called = true; |
| 581 | const result = ReflectApply(callback, this, args); |
| 582 | returnValue = preserveReturnValue ? result : undefined; |
| 583 | return result; |
| 584 | }; |
| 585 | } |
| 586 | |
| 587 | let validateUint32; |
| 588 |
no outgoing calls
no test coverage detected
searching dependent graphs…