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

pub enum PropertyDefinition {
    IdentifierReference(Box<str>),
    Property(Box<str>, Node),
    MethodDefinition(MethodDefinitionKindBox<str>, FunctionExpr),
    SpreadObject(Node),
}

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:

Property(Box<str>, Node)

Binds a property name to a JavaScript value.

More information:

MethodDefinition(MethodDefinitionKindBox<str>, FunctionExpr)

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

More information:

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:

Implementations

impl PropertyDefinition[src]

pub fn identifier_reference<I>(ident: I) -> Self where
    I: Into<Box<str>>, 
[src]

Creates an IdentifierReference property definition.

pub fn property<N, V>(name: N, value: V) -> Self where
    N: Into<Box<str>>,
    V: Into<Node>, 
[src]

Creates a Property definition.

pub fn method_definition<N>(
    kind: MethodDefinitionKind,
    name: N,
    body: FunctionExpr
) -> Self where
    N: Into<Box<str>>, 
[src]

Creates a MethodDefinition.

pub fn spread_object<O>(obj: O) -> Self where
    O: Into<Node>, 
[src]

Creates a SpreadObject.

Trait Implementations

impl Clone for PropertyDefinition[src]

impl Debug for PropertyDefinition[src]

impl Drop for PropertyDefinition[src]

impl Finalize for PropertyDefinition[src]

impl PartialEq<PropertyDefinition> for PropertyDefinition[src]

impl StructuralPartialEq for PropertyDefinition[src]

impl Trace for PropertyDefinition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NativeObject for T where
    T: Any + Debug + Trace
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,