We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
AstBulder::move_property_key
1 parent d1b7181 commit 63a95e4Copy full SHA for 63a95e4
crates/oxc_ast/src/ast_builder_impl.rs
@@ -134,6 +134,12 @@ impl<'a> AstBuilder<'a> {
134
mem::replace(target, dummy.into())
135
}
136
137
+ /// Moves the property key out by replacing it with a [`PropertyKey::NullLiteral`].
138
+ pub fn move_property_key(self, key: &mut PropertyKey<'a>) -> PropertyKey<'a> {
139
+ let null_expr = PropertyKey::from(self.expression_null_literal(SPAN));
140
+ mem::replace(key, null_expr)
141
+ }
142
+
143
/// Move a declaration out by replacing it with an empty [`Declaration::VariableDeclaration`].
144
#[inline]
145
pub fn move_declaration(self, decl: &mut Declaration<'a>) -> Declaration<'a> {
0 commit comments