refactor(jsdoc-core): remove obsolete getter and method

This commit is contained in:
Jeff Williams 2025-02-11 21:22:49 -08:00
parent 457c38fd4d
commit 153b899c2e
No known key found for this signature in database
3 changed files with 1 additions and 19 deletions

View File

@ -105,16 +105,6 @@ export default class Env {
return this.conf;
}
// TODO: Remove.
get env() {
return this;
}
// TODO: Remove.
get(key) {
return this[key];
}
get options() {
return this.opts;
}

View File

@ -46,14 +46,6 @@ describe('@jsdoc/core.Env', () => {
expect(env.emitter).toBeInstanceOf(EventEmitter);
});
it('has an `env` getter', () => {
expect(env.env).toBe(env);
});
it('has a `get` method that returns the value of the specified property', () => {
expect(env.get('sourceFiles')).toBe(env.sourceFiles);
});
it('has a `log` property that contains logging functions', () => {
expect(env.log).toBeObject();

View File

@ -29,7 +29,7 @@ function makeDoclet(comment, meta, env) {
env ??= jsdoc.env;
doclet = new Doclet(`/**\n${comment.join('\n')}\n*/`, meta, env);
if (meta?._emitEvent !== false) {
env.get('emitter').emit('newDoclet', { doclet });
env.emitter.emit('newDoclet', { doclet });
}
return doclet;