Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ast): add
AstBuilder::atom_from_cow
(#7974)
Various methods e.g. `PropertyKey::static_name` return a `Cow<'a, str>`. When we need to create an `Atom` from such a `Cow`, we can avoid reallocating the string into arena again if the `Cow` already borrows an arena string. The `Atom` can reference that same string, rather than making another copy of it in arena. Add `AstBuilder::atom_from_cow` method for this purpose.
- Loading branch information