mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
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:
parent
cedf5c4f6a
commit
ac5c6018a8
5 changed files with 888 additions and 43 deletions
|
@ -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:
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue