ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
29 lines (27 loc) • 967 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const callBaseFill_1 = require("./../callBaseFill");
const Scope_1 = require("./../common/Scope");
const scopeableNode = require("./ScopeableNode");
function ScopedNode(Base) {
return class extends Base {
getScope() {
return scopeableNode.getScopeForNode(this) || Scope_1.Scope.Public;
}
setScope(scope) {
scopeableNode.setScopeForNode(this, scope === Scope_1.Scope.Public ? undefined : scope);
return this;
}
hasScopeKeyword() {
return scopeableNode.getScopeForNode(this) != null;
}
fill(structure) {
callBaseFill_1.callBaseFill(Base.prototype, this, structure);
if (structure.scope != null)
this.setScope(structure.scope);
return this;
}
};
}
exports.ScopedNode = ScopedNode;
//# sourceMappingURL=ScopedNode.js.map