(proto, throwError)
| 1 | function patchPushError(proto, throwError) { |
| 2 | const _pushError = proto.pushError; |
| 3 | proto.pushError = function(error) { |
| 4 | if (error !== null && error.type === "validation") { |
| 5 | const err = new Error(error.value ?? "unknown"); |
| 6 | err.name = "WebGPUValidationError"; |
| 7 | if (throwError) throw err; |
| 8 | else console.error(err); |
| 9 | } |
| 10 | _pushError.call(proto, error); |
| 11 | }; |
| 12 | } |
| 13 | function enableValidationErrors(device, throwError = false) { |
| 14 | const _InnerDevice = Object.getOwnPropertySymbols(device).find((e)=>e.description === "[[device]]" |
| 15 | ); |
no outgoing calls
no test coverage detected