[][src]Enum boa::syntax::ast::op::CompOp

pub enum CompOp {
    Equal,
    NotEqual,
    StrictEqual,
    StrictNotEqual,
    GreaterThan,
    GreaterThanOrEqual,
    LessThan,
    LessThanOrEqual,
    In,
}

A comparison operator compares its operands and returns a logical value based on whether the comparison is true.

The operands can be numerical, string, logical, or object values. Strings are compared based on standard lexicographical ordering, using Unicode values. In most cases, if the two operands are not of the same type, JavaScript attempts to convert them to an appropriate type for the comparison. This behavior generally results in comparing the operands numerically. The sole exceptions to type conversion within comparisons involve the === and !== operators, which perform strict equality and inequality comparisons. These operators do not attempt to convert the operands to compatible types before checking equality.

More information:

Variants

Equal

The equality operator converts the operands if they are not of the same type, then applies strict comparison.

Syntax: y == y

If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.

More information:

NotEqual

The inequality operator returns true if the operands are not equal.

Syntax: x != y

If the two operands are not of the same type, JavaScript attempts to convert the operands to an appropriate type for the comparison. If both operands are objects, then JavaScript compares internal references which are not equal when operands refer to different objects in memory.

More information:

StrictEqual

The identity operator returns true if the operands are strictly equal with no type conversion.

Syntax: x === y

Returns true if the operands are equal and of the same type.

More information:

StrictNotEqual

The non-identity operator returns true if the operands are not equal and/or not of the same type.

Syntax: x !== y

Returns true if the operands are of the same type but not equal, or are of different type.

More information:

GreaterThan

The greater than operator returns true if the left operand is greater than the right operand.

Syntax: x > y

Returns true if the left operand is greater than the right operand.

More information:

GreaterThanOrEqual

The greater than or equal operator returns true if the left operand is greater than or equal to the right operand.

Syntax: x >= y

Returns true if the left operand is greater than the right operand.

More information:

LessThan

The less than operator returns true if the left operand is less than the right operand.

Syntax: x < y

Returns true if the left operand is less than the right operand.

More information:

LessThanOrEqual

The less than or equal operator returns true if the left operand is less than or equal to the right operand.

Syntax: x <= y

Returns true if the left operand is less than or equal to the right operand.

More information:

In

The in operator returns true if the specified property is in the specified object or its prototype chain.

Syntax: prop in object

Returns true the specified property is in the specified object or its prototype chain.

More information:

Trait Implementations

impl Clone for CompOp[src]

impl Copy for CompOp[src]

impl Debug for CompOp[src]

impl Display for CompOp[src]

impl Finalize for CompOp[src]

impl From<CompOp> for BinOp[src]

impl PartialEq<CompOp> for CompOp[src]

impl StructuralPartialEq for CompOp[src]

impl Trace for CompOp[src]

Auto Trait Implementations

impl RefUnwindSafe for CompOp

impl Send for CompOp

impl Sync for CompOp

impl Unpin for CompOp

impl UnwindSafe for CompOp

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,