use Map instead of IIndexable

This commit is contained in:
Mohamed Hegazy 2014-07-23 18:39:37 -07:00
parent e5d810384c
commit e23ff87f5a
8 changed files with 13 additions and 9 deletions

View file

@ -81,7 +81,7 @@ module TypeScript {
return Hash.computeMurmur2StringHashCode(key, seed);
}
public addKeys(keys: IIndexable<any>) {
public addKeys(keys: ts.Map<any>) {
for (var name in keys) {
if (keys[name]) {
this.add(name);

View file

@ -39,7 +39,7 @@ module TypeScript {
}
}
export function createIntrinsicsObject<T>(): IIndexable<T> {
export function createIntrinsicsObject<T>(): ts.Map<T> {
return new BlockIntrinsics<T>();
}

View file

@ -16,6 +16,10 @@
///<reference path='references.ts' />
module TypeScript {
export interface ILineAndCharacter {
line: number;
character: number;
}
// Note: This is being using by the host (VS) and is marshaled back and forth. When changing this make sure the changes
// are reflected in the managed side as well.

View file

@ -44,7 +44,7 @@ module TypeScript {
export class ReferenceResolver {
private inputFileNames: string[];
private host: IReferenceResolverHost;
private visited: IIndexable<string>;
private visited: ts.Map<string>;
constructor(inputFileNames: string[], host: IReferenceResolverHost, private useCaseSensitiveFileResolution: boolean) {
this.inputFileNames = inputFileNames;

View file

@ -1,7 +1,7 @@
///<reference path='references.ts' />
module TypeScript {
export var LocalizedDiagnosticMessages: IIndexable<any> = null;
export var LocalizedDiagnosticMessages: ts.Map<any> = null;
export class Location {
private _fileName: string;
@ -120,7 +120,7 @@ module TypeScript {
// TODO: We need to expose an extensibility point on our hosts to have them tell us what
// they want the newline string to be. That way we can get the correct result regardless
// of which host we use
return Environment ? Environment.newLine : "\r\n";
return sys.newLine ? sys.newLine : "\r\n";
}
function getLargestIndex(diagnostic: string): number {

View file

@ -18,7 +18,7 @@
module TypeScript.Services.Formatting {
export class Rules {
public getRuleName(rule: Rule) {
var o: IIndexable<any> = <any>this;
var o: ts.Map<any> = <any>this;
for (var name in o) {
if (o[name] === rule) {
return name;

View file

@ -2,9 +2,9 @@
///<reference path='references.ts' />
module TypeScript.Services {
interface LexicalScope {
items: TypeScript.IIndexable<NavigateToItem>;
items: ts.Map<NavigateToItem>;
itemNames: string[];
childScopes: TypeScript.IIndexable<LexicalScope>;
childScopes: ts.Map<LexicalScope>;
childScopeNames: string[];
}

View file

@ -1,7 +1,7 @@
// <auto-generated />
/// <reference path="..\core\diagnosticCategory.ts" />
module TypeScript {
export var diagnosticInformationMap: IIndexable<any> = {
export var diagnosticInformationMap: ts.Map<any> = {
"error TS{0}: {1}": { "code": 0, "category": DiagnosticCategory.NoPrefix },
"warning TS{0}: {1}": { "code": 1, "category": DiagnosticCategory.NoPrefix },
"Unrecognized escape sequence.": { "code": 1000, "category": DiagnosticCategory.Error },