()
| 141 | } |
| 142 | |
| 143 | disable() { |
| 144 | const { 0: hooks_array, 1: hook_fields } = getHookArrays(); |
| 145 | |
| 146 | const index = ArrayPrototypeIndexOf(hooks_array, this); |
| 147 | if (index === -1) |
| 148 | return this; |
| 149 | |
| 150 | const prev_kTotals = hook_fields[kTotals]; |
| 151 | |
| 152 | hook_fields[kTotals] = hook_fields[kInit] -= +!!this[init_symbol]; |
| 153 | hook_fields[kTotals] += hook_fields[kBefore] -= +!!this[before_symbol]; |
| 154 | hook_fields[kTotals] += hook_fields[kAfter] -= +!!this[after_symbol]; |
| 155 | hook_fields[kTotals] += hook_fields[kDestroy] -= +!!this[destroy_symbol]; |
| 156 | hook_fields[kTotals] += |
| 157 | hook_fields[kPromiseResolve] -= +!!this[promise_resolve_symbol]; |
| 158 | ArrayPrototypeSplice(hooks_array, index, 1); |
| 159 | |
| 160 | if (prev_kTotals > 0 && hook_fields[kTotals] === 0) { |
| 161 | disableHooks(); |
| 162 | } |
| 163 | |
| 164 | return this; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 |
nothing calls this directly
no test coverage detected