mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Removed duplicate 'getNodeModifiers'.
This commit is contained in:
@@ -85,7 +85,7 @@ module ts {
|
||||
forEach((<Block>functionDeclaration.body).statements, s => s.kind === SyntaxKind.FunctionDeclaration);
|
||||
}
|
||||
|
||||
function getItemsWorker(nodes: Node[], createItem: (n: Node) => ts.NavigationBarItem): ts.NavigationBarItem[]{
|
||||
function getItemsWorker(nodes: Node[], createItem: (n: Node) => ts.NavigationBarItem): ts.NavigationBarItem[] {
|
||||
var items: ts.NavigationBarItem[] = [];
|
||||
|
||||
if (!nodes) {
|
||||
@@ -341,20 +341,6 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: use implementation in services.ts
|
||||
function getNodeModifiers(node: Node): string {
|
||||
var flags = node.flags;
|
||||
var result: string[] = [];
|
||||
|
||||
if (flags & NodeFlags.Private) result.push(ScriptElementKindModifier.privateMemberModifier);
|
||||
if (flags & NodeFlags.Public) result.push(ScriptElementKindModifier.publicMemberModifier);
|
||||
if (flags & NodeFlags.Static) result.push(ScriptElementKindModifier.staticModifier);
|
||||
if (flags & NodeFlags.Export) result.push(ScriptElementKindModifier.exportedModifier);
|
||||
if (isInAmbientContext(node)) result.push(ScriptElementKindModifier.ambientModifier);
|
||||
|
||||
return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none;
|
||||
}
|
||||
|
||||
function getInnermostModule(node: ModuleDeclaration): ModuleDeclaration {
|
||||
|
||||
while (node.body.kind === SyntaxKind.ModuleDeclaration) {
|
||||
|
||||
@@ -1351,6 +1351,19 @@ module ts {
|
||||
}
|
||||
|
||||
/// Helpers
|
||||
export function getNodeModifiers(node: Node): string {
|
||||
var flags = node.flags;
|
||||
var result: string[] = [];
|
||||
|
||||
if (flags & NodeFlags.Private) result.push(ScriptElementKindModifier.privateMemberModifier);
|
||||
if (flags & NodeFlags.Public) result.push(ScriptElementKindModifier.publicMemberModifier);
|
||||
if (flags & NodeFlags.Static) result.push(ScriptElementKindModifier.staticModifier);
|
||||
if (flags & NodeFlags.Export) result.push(ScriptElementKindModifier.exportedModifier);
|
||||
if (isInAmbientContext(node)) result.push(ScriptElementKindModifier.ambientModifier);
|
||||
|
||||
return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none;
|
||||
}
|
||||
|
||||
function getTargetLabel(referenceNode: Node, labelName: string): Identifier {
|
||||
while (referenceNode) {
|
||||
if (referenceNode.kind === SyntaxKind.LabeledStatement && (<LabeledStatement>referenceNode).label.text === labelName) {
|
||||
@@ -2198,19 +2211,6 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeModifiers(node: Node): string {
|
||||
var flags = node.flags;
|
||||
var result: string[] = [];
|
||||
|
||||
if (flags & NodeFlags.Private) result.push(ScriptElementKindModifier.privateMemberModifier);
|
||||
if (flags & NodeFlags.Public) result.push(ScriptElementKindModifier.publicMemberModifier);
|
||||
if (flags & NodeFlags.Static) result.push(ScriptElementKindModifier.staticModifier);
|
||||
if (flags & NodeFlags.Export) result.push(ScriptElementKindModifier.exportedModifier);
|
||||
if (isInAmbientContext(node)) result.push(ScriptElementKindModifier.ambientModifier);
|
||||
|
||||
return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none;
|
||||
}
|
||||
|
||||
/// QuickInfo
|
||||
function getTypeAtPosition(fileName: string, position: number): TypeInfo {
|
||||
synchronizeHostData();
|
||||
|
||||
Reference in New Issue
Block a user