persona-community-5/.pnpm-store/v3/files/b1/28fc90d553ebc189de5dff484caa8feeceaa1a6d4f933cb73f87799010e60d8ad39e4d0e1412f3dcf6c13b182dae40b6d42561e2ff00079caa1b49805d7944
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

39 lines
1.7 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlobalScope = void 0;
const types_1 = require("@typescript-eslint/types");
const assert_1 = require("../assert");
const ImplicitGlobalVariableDefinition_1 = require("../definition/ImplicitGlobalVariableDefinition");
const variable_1 = require("../variable");
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class GlobalScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, block) {
super(scopeManager, ScopeType_1.ScopeType.global, null, block, false);
this.implicit = {
set: new Map(),
variables: [],
leftToBeResolved: [],
};
}
defineImplicitVariable(name, options) {
this.defineVariable(new variable_1.ImplicitLibVariable(this, name, options), this.set, this.variables, null, null);
}
close(scopeManager) {
(0, assert_1.assert)(this.leftToResolve);
for (const ref of this.leftToResolve) {
if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
// create an implicit global variable from assignment expression
const info = ref.maybeImplicitGlobal;
const node = info.pattern;
if (node.type === types_1.AST_NODE_TYPES.Identifier) {
this.defineVariable(node.name, this.implicit.set, this.implicit.variables, node, new ImplicitGlobalVariableDefinition_1.ImplicitGlobalVariableDefinition(info.pattern, info.node));
}
}
}
this.implicit.leftToBeResolved = this.leftToResolve;
return super.close(scopeManager);
}
}
exports.GlobalScope = GlobalScope;
//# sourceMappingURL=GlobalScope.js.map