Enum boa::syntax::ast::node::PropertyDefinition [−][src]
pub enum PropertyDefinition {
IdentifierReference(Box<str>),
Property(PropertyName, Node),
MethodDefinition(MethodDefinitionKind, PropertyName, FunctionExpr),
SpreadObject(Node),
}Expand description
A JavaScript property is a characteristic of an object, often describing attributes associated with a data structure.
A property has a name (a string) and a value (primitive, method, or object reference). Note that when we say that “a property holds an object”, that is shorthand for “a property holds an object reference”. This distinction matters because the original referenced object remains unchanged when you change the property’s value.
More information:
Variants
Property(PropertyName, Node)Binds a property name to a JavaScript value.
More information:
Tuple Fields of Property
0: PropertyName1: NodeMethodDefinition(MethodDefinitionKind, PropertyName, FunctionExpr)A property of an object can also refer to a function or a getter or setter method.
More information:
Tuple Fields of MethodDefinition
SpreadObject(Node)The Rest/Spread Properties for ECMAScript proposal (stage 4) adds spread properties to object literals. It copies own enumerable properties from a provided object onto a new object.
Shallow-cloning (excluding prototype) or merging objects is now possible using a shorter syntax than Object.assign().
More information:
Tuple Fields of SpreadObject
0: NodeImplementations
Creates an IdentifierReference property definition.
Creates a Property definition.
pub fn method_definition<N>(
kind: MethodDefinitionKind,
name: N,
body: FunctionExpr
) -> Self where
N: Into<PropertyName>,
pub fn method_definition<N>(
kind: MethodDefinitionKind,
name: N,
body: FunctionExpr
) -> Self where
N: Into<PropertyName>,
Creates a MethodDefinition.
Creates a SpreadObject.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Runs Finalize::finalize() on this object and all contained subobjects Read more
Auto Trait Implementations
impl !RefUnwindSafe for PropertyDefinition
impl !Send for PropertyDefinition
impl !Sync for PropertyDefinition
impl Unpin for PropertyDefinition
impl UnwindSafe for PropertyDefinition
Blanket Implementations
Mutably borrows from an owned value. Read more