[][src]Struct boa::exec::Interpreter

pub struct Interpreter {
    pub realm: Realm,
    // some fields omitted
}

A Javascript intepreter

Fields

realm: Realm

realm holds both the global object and the environment

Implementations

impl Interpreter[src]

pub fn construct_range_error<M>(&mut self, message: M) -> Value where
    M: Into<String>, 
[src]

Constructs a RangeError with the specified message.

pub fn throw_range_error<M>(&mut self, message: M) -> ResultValue where
    M: Into<String>, 
[src]

Throws a RangeError with the specified message.

pub fn construct_type_error<M>(&mut self, message: M) -> Value where
    M: Into<String>, 
[src]

Constructs a TypeError with the specified message.

pub fn throw_type_error<M>(&mut self, message: M) -> ResultValue where
    M: Into<String>, 
[src]

Throws a TypeError with the specified message.

pub fn construct_reference_error<M>(&mut self, message: M) -> Value where
    M: Into<String>, 
[src]

Constructs a ReferenceError with the specified message.

pub fn throw_reference_error<M>(&mut self, message: M) -> ResultValue where
    M: Into<String>, 
[src]

Throws a ReferenceError with the specified message.

impl Interpreter[src]

pub fn new(realm: Realm) -> Self[src]

Creates a new interpreter.

pub fn to_string(&mut self, value: &Value) -> Result<RcString, Value>[src]

Converts a value into a rust heap allocated string.

pub fn to_bigint(&mut self, value: &Value) -> Result<RcBigInt, Value>[src]

Helper function.

pub fn to_index(&mut self, value: &Value) -> Result<usize, Value>[src]

Converts a value to a non-negative integer if it is a valid integer index value.

See: https://tc39.es/ecma262/#sec-toindex

pub fn to_integer(&mut self, value: &Value) -> Result<i64, Value>[src]

Converts a value to an integral 64 bit signed integer.

See: https://tc39.es/ecma262/#sec-tointeger

pub fn to_number(&mut self, value: &Value) -> Result<f64, Value>[src]

Converts a value to a double precision floating point.

See: https://tc39.es/ecma262/#sec-tonumber

pub fn to_numeric(&mut self, value: &Value) -> ResultValue[src]

It returns value converted to a numeric value of type Number or BigInt.

See: https://tc39.es/ecma262/#sec-tonumeric

pub fn require_object_coercible<'a>(
    &mut self,
    value: &'a Value
) -> Result<&'a Value, Value>
[src]

Check if the Value can be converted to an Object

The abstract operation RequireObjectCoercible takes argument argument. It throws an error if argument is a value that cannot be converted to an Object using ToObject. It is defined by Table 15

More information:

Trait Implementations

impl Debug for Interpreter[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, 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>,