"use strict";
/*
 * edge-parser
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
const makeStatePropertyAccessor_1 = require("../Parser/makeStatePropertyAccessor");
exports.default = {
    toStatement(statement, _, parser) {
        if ((parser.options.localVariables || []).indexOf(statement.name) > -1 ||
            parser.stack.has(statement.name) ||
            global[statement.name] !== undefined) {
            return statement;
        }
        return (0, makeStatePropertyAccessor_1.makeStatePropertyAccessor)(parser.options.statePropertyName, statement);
    },
};
