function evaluateGetAccessorDeclaration({ node, environment, evaluate, stack, reporting, typescript, statementTraversalStack }, parent) {
    const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);
    const isStatic = inStaticContext(node, typescript);
    if (parent == null) {
        let updatedParent;
        if (typescript.isClassLike(node.parent)) {
            evaluate.declaration(node.parent, environment, statementTraversalStack);
            updatedParent = stack.pop();
        }
        else {
            updatedParent = evaluate.expression(node.parent, environment, statementTraversalStack);
        }
        stack.push(isStatic ? updatedParent[nameResult] : updatedParent.prototype[nameResult]);
        return;
    }
    /**
     * An implementation of the get accessor
     */
    function getAccessorDeclaration() {
        // Prepare a lexical environment for the function context
        const localLexicalEnvironment = cloneLexicalEnvironment(environment);
        // Define a new binding for a return symbol within the environment
        setInLexicalEnvironment({ env: localLexicalEnvironment, path: RETURN_SYMBOL, value: false, newBinding: true, reporting, node });
        // Define a new binding for the arguments given to the function
        // eslint-disable-next-line prefer-rest-params
        setInLexicalEnvironment({ env: localLexicalEnvironment, path: "arguments", value: arguments, newBinding: true, reporting, node });
        if (this != null) {
            setInLexicalEnvironment({ env: localLexicalEnvironment, path: THIS_SYMBOL, value: this, newBinding: true, reporting, node });
            // Set the 'super' binding, depending on whether or not we're inside a static context
            setInLexicalEnvironment({
                env: localLexicalEnvironment,
                path: SUPER_SYMBOL,
                value: isStatic ? Object.getPrototypeOf(this) : Object.getPrototypeOf(this.constructor).prototype,
                newBinding: true,
                reporting,
                node
            });
        }
        // If the body is a block, evaluate it as a statement
        if (node.body == null)
            return;
        evaluate.statement(node.body, localLexicalEnvironment);
        // If a 'return' has occurred within the block, pop the Stack and return that value
        if (pathInLexicalEnvironmentEquals(node, localLexicalEnvironment, true, RETURN_SYMBOL)) {
            return stack.pop();
        }
        // Otherwise, return 'undefined'. Nothing is returned from the function
        else
            return undefined;
    }
    getAccessorDeclaration.toString = () => `[Get: ${nameResult}]`;
    let currentPropertyDescriptor = Object.getOwnPropertyDescriptor(parent, nameResult);
    if (currentPropertyDescriptor == null)
        currentPropertyDescriptor = {};
    Object.defineProperty(parent, nameResult, Object.assign(Object.assign({}, currentPropertyDescriptor), { configurable: true, get: getAccessorDeclaration }));
}
/**
 * Evaluates, or attempts to evaluate, a GetAccessorDeclaration, before setting it on the given parent
 */
Evaluates, or attempts to evaluate, a GetAccessorDeclaration, before setting it on the given parent
Evaluates or attempts to evaluate a GetAccessorDeclaration before setting it on the given parent
function evaluateGetAccessorDeclaration({ node, environment, evaluate, stack, reporting, typescript, statementTraversalStack }, parent) {
    const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);
    const isStatic = inStaticContext(node, typescript);
    if (parent == null) {
        let updatedParent;
        if (typescript.isClassLike(node.parent)) {
            evaluate.declaration(node.parent, environment, statementTraversalStack);
            updatedParent = stack.pop();
        }
        else {
            updatedParent = evaluate.expression(node.parent, environment, statementTraversalStack);
        }
        stack.push(isStatic ? updatedParent[nameResult] : updatedParent.prototype[nameResult]);
        return;
    }
    function getAccessorDeclaration() {
        const localLexicalEnvironment = cloneLexicalEnvironment(environment);
        setInLexicalEnvironment({ env: localLexicalEnvironment, path: RETURN_SYMBOL, value: false, newBinding: true, reporting, node });
        setInLexicalEnvironment({ env: localLexicalEnvironment, path: "arguments", value: arguments, newBinding: true, reporting, node });
        if (this != null) {
            setInLexicalEnvironment({ env: localLexicalEnvironment, path: THIS_SYMBOL, value: this, newBinding: true, reporting, node });
            setInLexicalEnvironment({
                env: localLexicalEnvironment,
                path: SUPER_SYMBOL,
                value: isStatic ? Object.getPrototypeOf(this) : Object.getPrototypeOf(this.constructor).prototype,
                newBinding: true,
                reporting,
                node
            });
        }
        if (node.body == null)
            return;
        evaluate.statement(node.body, localLexicalEnvironment);
        if (pathInLexicalEnvironmentEquals(node, localLexicalEnvironment, true, RETURN_SYMBOL)) {
            return stack.pop();
        }
        else
            return undefined;
    }
    getAccessorDeclaration.toString = () => `[Get: ${nameResult}]`;
    let currentPropertyDescriptor = Object.getOwnPropertyDescriptor(parent, nameResult);
    if (currentPropertyDescriptor == null)
        currentPropertyDescriptor = {};
    Object.defineProperty(parent, nameResult, Object.assign(Object.assign({}, currentPropertyDescriptor), { configurable: true, get: getAccessorDeclaration }));
}
function evaluateGetAccessorDeclaration ( { node , environment , evaluate , stack , reporting , typescript , statementTraversalStack } , parent ) { const nameResult = evaluate . nodeWithValue ( node . name , environment , statementTraversalStack ) ; const isStatic = inStaticContext ( node , typescript ) ; if ( parent == null ) { let updatedParent ; if ( typescript . isClassLike ( node . parent ) ) { evaluate . declaration ( node . parent , environment , statementTraversalStack ) ; updatedParent = stack . pop ( ) ; } else { updatedParent = evaluate . expression ( node . parent , environment , statementTraversalStack ) ; } stack . push ( isStatic ? updatedParent [ nameResult ] : updatedParent . prototype [ nameResult ] ) ; return ; } function getAccessorDeclaration ( ) { const localLexicalEnvironment = cloneLexicalEnvironment ( environment ) ; setInLexicalEnvironment ( { env : localLexicalEnvironment , path : RETURN_SYMBOL , value : false , newBinding : true , reporting , node } ) ; setInLexicalEnvironment ( { env : localLexicalEnvironment , path : "arguments" , value : arguments , newBinding : true , reporting , node } ) ; if ( this != null ) { setInLexicalEnvironment ( { env : localLexicalEnvironment , path : THIS_SYMBOL , value : this , newBinding : true , reporting , node } ) ; setInLexicalEnvironment ( { env : localLexicalEnvironment , path : SUPER_SYMBOL , value : isStatic ? Object . getPrototypeOf ( this ) : Object . getPrototypeOf ( this . constructor ) . prototype , newBinding : true , reporting , node } ) ; } if ( node . body == null ) return ; evaluate . statement ( node . body , localLexicalEnvironment ) ; if ( pathInLexicalEnvironmentEquals ( node , localLexicalEnvironment , true , RETURN_SYMBOL ) ) { return stack . pop ( ) ; } else return undefined ; } getAccessorDeclaration . toString = ( ) => ` ${ nameResult } ` ; let currentPropertyDescriptor = Object . getOwnPropertyDescriptor ( parent , nameResult ) ; if ( currentPropertyDescriptor == null ) currentPropertyDescriptor = { } ; Object . defineProperty ( parent , nameResult , Object . assign ( Object . assign ( { } , currentPropertyDescriptor ) , { configurable : true , get : getAccessorDeclaration } ) ) ; }
Evaluates, or attempts to evaluate, a GetAccessorDeclaration, before setting it on the given parent
Evaluates or attempts to evaluate a GetAccessorDeclaration before setting it on the given parent
/**
     * An implementation of the get accessor
     */ // Prepare a lexical environment for the function context // Define a new binding for a return symbol within the environment // Define a new binding for the arguments given to the function // eslint-disable-next-line prefer-rest-params // Set the 'super' binding, depending on whether or not we're inside a static context // If the body is a block, evaluate it as a statement // If a 'return' has occurred within the block, pop the Stack and return that value // Otherwise, return 'undefined'. Nothing is returned from the function