mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Store the DI decorator's id in specific property (#5131).
This commit is contained in:
@@ -67,7 +67,7 @@ export class InstantiationService implements IInstantiationService {
|
||||
for (const dependency of serviceDependencies) {
|
||||
const service = this._services.get(dependency.id);
|
||||
if (!service) {
|
||||
throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`);
|
||||
throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id._id}.`);
|
||||
}
|
||||
serviceArgs.push(service);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export function createDecorator<T>(id: string): IServiceIdentifier<T> {
|
||||
storeServiceDependency(decorator, target, index);
|
||||
};
|
||||
|
||||
decorator.toString = () => id;
|
||||
decorator._id = id;
|
||||
|
||||
serviceRegistry.set(id, decorator);
|
||||
return decorator;
|
||||
|
||||
@@ -124,6 +124,7 @@ export interface ICharsetService {
|
||||
export interface IServiceIdentifier<T> {
|
||||
(...args: any[]): void;
|
||||
type: T;
|
||||
_id: string;
|
||||
}
|
||||
|
||||
export interface IBrandedService {
|
||||
|
||||
Reference in New Issue
Block a user