@@ -17,18 +17,17 @@ import { ITheme, IThemeService, ThemeColor } from 'vs/platform/theme/common/them
1717export abstract class CodeEditorServiceImpl extends AbstractCodeEditorService {
1818
1919 private readonly _styleSheet : HTMLStyleElement ;
20- private readonly _decorationOptionProviders : { [ key : string ] : IModelDecorationOptionsProvider } ;
20+ private readonly _decorationOptionProviders = new Map < string , IModelDecorationOptionsProvider > ( ) ;
2121 private readonly _themeService : IThemeService ;
2222
2323 constructor ( @IThemeService themeService : IThemeService , styleSheet = dom . createStyleSheet ( ) ) {
2424 super ( ) ;
2525 this . _styleSheet = styleSheet ;
26- this . _decorationOptionProviders = Object . create ( null ) ;
2726 this . _themeService = themeService ;
2827 }
2928
3029 public registerDecorationType ( key : string , options : IDecorationRenderOptions , parentTypeKey ?: string ) : void {
31- let provider = this . _decorationOptionProviders [ key ] ;
30+ let provider = this . _decorationOptionProviders . get ( key ) ;
3231 if ( ! provider ) {
3332 const providerArgs : ProviderArguments = {
3433 styleSheet : this . _styleSheet ,
@@ -41,25 +40,25 @@ export abstract class CodeEditorServiceImpl extends AbstractCodeEditorService {
4140 } else {
4241 provider = new DecorationSubTypeOptionsProvider ( this . _themeService , providerArgs ) ;
4342 }
44- this . _decorationOptionProviders [ key ] = provider ;
43+ this . _decorationOptionProviders . set ( key , provider ) ;
4544 }
4645 provider . refCount ++ ;
4746 }
4847
4948 public removeDecorationType ( key : string ) : void {
50- const provider = this . _decorationOptionProviders [ key ] ;
49+ const provider = this . _decorationOptionProviders . get ( key ) ;
5150 if ( provider ) {
5251 provider . refCount -- ;
5352 if ( provider . refCount <= 0 ) {
54- delete this . _decorationOptionProviders [ key ] ;
53+ this . _decorationOptionProviders . delete ( key ) ;
5554 provider . dispose ( ) ;
5655 this . listCodeEditors ( ) . forEach ( ( ed ) => ed . removeDecorations ( key ) ) ;
5756 }
5857 }
5958 }
6059
6160 public resolveDecorationOptions ( decorationTypeKey : string , writable : boolean ) : IModelDecorationOptions {
62- const provider = this . _decorationOptionProviders [ decorationTypeKey ] ;
61+ const provider = this . _decorationOptionProviders . get ( decorationTypeKey ) ;
6362 if ( ! provider ) {
6463 throw new Error ( 'Unknown decoration type key: ' + decorationTypeKey ) ;
6564 }
0 commit comments