Enum boa::syntax::ast::node::PropertyDefinition[][src]

pub enum PropertyDefinition {
    IdentifierReference(Box<str>),
    Property(PropertyNameNode),
    MethodDefinition(MethodDefinitionKindPropertyNameFunctionExpr),
    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

IdentifierReference(Box<str>)

Puts a variable into an object.

More information:

Tuple Fields of IdentifierReference

0: Box<str>
Property(PropertyNameNode)

Binds a property name to a JavaScript value.

More information:

Tuple Fields of Property

0: PropertyName1: Node

A property of an object can also refer to a function or a getter or setter method.

More information:

Tuple Fields of MethodDefinition

0: MethodDefinitionKind1: PropertyName2: FunctionExpr
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: Node

Implementations

Creates an IdentifierReference property definition.

Creates a Property definition.

Creates a MethodDefinition.

Creates a SpreadObject.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Marks all contained Gcs.

Increments the root-count of all contained Gcs.

Decrements the root-count of all contained Gcs.

Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert the Rust type which implements NativeObject to a &dyn Any.

Convert the Rust type which implements NativeObject to a &mut dyn Any.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.