function evaluateSetAccessorDeclaration(options, parent) {
    const { node, environment, evaluate, statementTraversalStack, reporting, typescript } = options;
    const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);
    const isStatic = inStaticContext(node, typescript);
    /**
     * An implementation of the set accessor
     */
    function setAccessorDeclaration(...args) {
        // 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
            });
        }
        // Evaluate the parameters based on the given arguments
        evaluateParameterDeclarations(Object.assign(Object.assign({}, options), { node: node.parameters, environment: localLexicalEnvironment }), args);
        // If the body is a block, evaluate it as a statement
        if (node.body == null)
            return;
        evaluate.statement(node.body, localLexicalEnvironment);
    }
    setAccessorDeclaration.toString = () => `[Set: ${nameResult}]`;
    let currentPropertyDescriptor = Object.getOwnPropertyDescriptor(parent, nameResult);
    if (currentPropertyDescriptor == null)
        currentPropertyDescriptor = {};
    Object.defineProperty(parent, nameResult, Object.assign(Object.assign({}, currentPropertyDescriptor), { configurable: true, set: setAccessorDeclaration }));
}
/**
 * Evaluates, or attempts to evaluate, a SetAccessorDeclaration, before setting it on the given parent
 */
Evaluates, or attempts to evaluate, a SetAccessorDeclaration, before setting it on the given parent
Evaluates or attempts to evaluate a SetAccessorDeclaration before setting it on the given parent
function evaluateSetAccessorDeclaration(options, parent) {
    const { node, environment, evaluate, statementTraversalStack, reporting, typescript } = options;
    const nameResult = evaluate.nodeWithValue(node.name, environment, statementTraversalStack);
    const isStatic = inStaticContext(node, typescript);
    function setAccessorDeclaration(...args) {
        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
            });
        }
        evaluateParameterDeclarations(Object.assign(Object.assign({}, options), { node: node.parameters, environment: localLexicalEnvironment }), args);
        if (node.body == null)
            return;
        evaluate.statement(node.body, localLexicalEnvironment);
    }
    setAccessorDeclaration.toString = () => `[Set: ${nameResult}]`;
    let currentPropertyDescriptor = Object.getOwnPropertyDescriptor(parent, nameResult);
    if (currentPropertyDescriptor == null)
        currentPropertyDescriptor = {};
    Object.defineProperty(parent, nameResult, Object.assign(Object.assign({}, currentPropertyDescriptor), { configurable: true, set: setAccessorDeclaration }));
}
function evaluateSetAccessorDeclaration ( options , parent ) { const { node , environment , evaluate , statementTraversalStack , reporting , typescript } = options ; const nameResult = evaluate . nodeWithValue ( node . name , environment , statementTraversalStack ) ; const isStatic = inStaticContext ( node , typescript ) ; function setAccessorDeclaration ( ... args ) { 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 } ) ; } evaluateParameterDeclarations ( Object . assign ( Object . assign ( { } , options ) , { node : node . parameters , environment : localLexicalEnvironment } ) , args ) ; if ( node . body == null ) return ; evaluate . statement ( node . body , localLexicalEnvironment ) ; } setAccessorDeclaration . toString = ( ) => ` ${ nameResult } ` ; let currentPropertyDescriptor = Object . getOwnPropertyDescriptor ( parent , nameResult ) ; if ( currentPropertyDescriptor == null ) currentPropertyDescriptor = { } ; Object . defineProperty ( parent , nameResult , Object . assign ( Object . assign ( { } , currentPropertyDescriptor ) , { configurable : true , set : setAccessorDeclaration } ) ) ; }
Evaluates, or attempts to evaluate, a SetAccessorDeclaration, before setting it on the given parent
Evaluates or attempts to evaluate a SetAccessorDeclaration before setting it on the given parent
/**
     * An implementation of the set 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 // Evaluate the parameters based on the given arguments // If the body is a block, evaluate it as a statement