AutoBE
    Preparing search index...

    New expression for object instantiation.

    Creates new instances of objects, primarily used for:

    • Error object creation for throw statements
    • Date object creation for timestamp values
    • Custom object instantiation when required by utility functions

    E2E testing context: Most commonly used for creating Error objects in throw statements or Date objects for time-sensitive test data. Also used for instantiating utility objects that don't involve API calls.

    AI function calling usage: Use when business logic requires explicit object instantiation rather than literal values, excluding API-related entity creation.

    interface INewExpression {
        arguments: IExpression[];
        expression: IExpression;
        type: "newExpression";
    }
    Index

    Properties

    arguments: IExpression[]

    Arguments passed to the constructor.

    Must match the constructor's parameter signature. For Error objects: typically string message For Date objects: typically string or number timestamp For other constructors: appropriate parameter types

    Arguments should be derived from captured data, literals, or computations, not from direct API calls.

    expression: IExpression

    Expression representing the constructor function.

    Typically an identifier for built-in constructors:

    • "Error" for error objects
    • "Date" for date objects
    • Custom class identifiers when needed for utility purposes

    Should NOT represent API-related constructors or entity builders.

    type: "newExpression"

    Type discriminator.