mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Various types have a `deepClone` method, but there are two different signatures in use. Some types, like those in the `css` directory, have an infallible `deepClone` method that cannot return an error. Others, like those in `ast`, are fallible and can return `error.OutOfMemory`. Historically, `BabyList.deepClone` has only worked with the fallible kind of `deepClone`, necessitating the addition of `BabyList.deepClone2`, which only works with the *in*fallible kind. This PR: * Updates `BabyList.deepClone` so that it works with both kinds of method * Updates `BabyList.deepClone2` so that it works with both kinds of method * Renames `BabyList.deepClone2` to `BabyList.deepCloneInfallible` * Adds `bun.handleOom(...)`, which is like `... catch bun.outOfMemory()` but it can't accidentally catch non-OOM-related errors * Replaces an occurrence of `anyerror` with a more specific error set (For internal tracking: fixes STAB-969, STAB-970) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
4.8 KiB
Executable File
4.8 KiB
Executable File