fix(unstable): add missing decorators nodes in lint ast (#28834)

Support for decorators in the lint plugin AST was a bit half baked. This
PR goes through all the places where decorators can be set in TS and
supports these.

Fixes https://github.com/denoland/deno/issues/28830
This commit is contained in:
Marvin Hagemeister 2025-04-10 17:49:05 +02:00 committed by GitHub
parent cedf5c4f6a
commit ac5c6018a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 888 additions and 43 deletions

View file

@ -534,6 +534,31 @@ impl SerializeCtx {
}
}
pub fn write_maybe_ref_vec_skip<P>(
&mut self,
prop: P,
parent_ref: &PendingRef,
value: Option<Vec<NodeRef>>,
) where
P: Into<u8> + Display + Clone,
{
if let Some(value) = value {
self.write_ref_vec(prop, parent_ref, value);
}
}
pub fn write_ref_vec_or_empty<P>(
&mut self,
prop: P,
parent_ref: &PendingRef,
value: Option<Vec<NodeRef>>,
) where
P: Into<u8> + Display + Clone,
{
let actual = value.unwrap_or_default();
self.write_ref_vec(prop, parent_ref, actual)
}
/// Serialize all information we have into a buffer that can be sent to JS.
/// It has the following structure:
///