()
| 6192 | currentBufferSize = Math.ceil(data.length / 4096) * 4096; |
| 6193 | currentBufferPtr = llhttp.malloc(currentBufferSize); |
| 6194 | } |
| 6195 | new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); |
| 6196 | try { |
| 6197 | let ret; |
| 6198 | try { |
| 6199 | currentBufferRef = data; |
| 6200 | currentParser = this; |
| 6201 | ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); |
| 6202 | } catch (err) { |
| 6203 | throw err; |
| 6204 | } finally { |
| 6205 | currentParser = null; |
| 6206 | currentBufferRef = null; |
| 6207 | } |
| 6208 | const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; |
| 6209 | if (ret !== constants3.ERROR.OK) { |
| 6210 | const body = data.subarray(offset); |
| 6211 | if (ret === constants3.ERROR.PAUSED_UPGRADE) { |
no test coverage detected