pub struct Program {
    pub body: BlockStatement,
    /* private fields */
}
Expand description

Represents a complete top-level JS script.

The only way to create a Program externally is to use LexicalContext::new_program, maybe via Program::parse_from or build::script helpers. This ensures that its bindings are statically analysed.

Fields

body: BlockStatement

Implementations

Makes a Program from anything that implements SourceNode

e.g. from a JSON ESTree.

Trait Implementations

Formats the value using the given formatter. Read more

Interpret self on the heap, potentially to a settable Interpreted::Member.

A wrapper for .interpret that also resolves the result to JSValue

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

This method tests for !=.

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.

The type returned in the event of a conversion error.

Performs the conversion.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.