mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(ast): implement From<Argument> for ArrayExpressionElement (#7830)
This commit is contained in:
parent
5172f32457
commit
6466a4a990
1 changed files with 10 additions and 0 deletions
|
|
@ -310,6 +310,16 @@ impl ArrayExpressionElement<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<Argument<'a>> for ArrayExpressionElement<'a> {
|
||||
fn from(argument: Argument<'a>) -> Self {
|
||||
if let Argument::SpreadElement(spread) = argument {
|
||||
ArrayExpressionElement::SpreadElement(spread)
|
||||
} else {
|
||||
ArrayExpressionElement::from(argument.into_expression())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ObjectPropertyKind<'_> {
|
||||
/// Returns `true` if this object property is a [spread](SpreadElement).
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Reference in a new issue